Serialcoder en Français Serialcoder in English
TEL : +33 (0)9 72 13 15 17

Windows Forms FAQ

2. Windows Forms Controls

2.1 How do you prevent serialization of certain child controls in your Composite Control?
2.2 How do I get hold of the currently focused Control?
2.3 Why do calling Focus() on a control not set focus on it?
2.4 How do I listen to windows messages in my Control?
2.5 How do I programatically change the color of a control?
2.6 How can I change the Border color of my control?
2.7 Why should I provide a Non-Client border to my Control derived class?
2.8 How do I provide a 2 pixel 3d border in the Non-Client area of my Control derived class?
2.9 How do I provide a 1 pixel border in the NonClient area of my Control?
2.10 How do I invalidate a control including it's NonClient area?
2.11 How can I implement a scrollable picture box?
2.12 How can I put Controls, a ProgressBar for example, into a StatusBar?
2.13 How do I implement an ownerdrawn statusbar so I can put a progressbar in it?
2.14 How would I change the icon that appears on the toolbox for a custom control?
2.15 A control's Validating event is hit even when the user clicks on the Close box. How can I avoid this behavior?
2.16 I would like to prevent validation in my textbox when the user clicks on my Cancel button, how do I do this?
2.17 Why does adding images to an ImageList in the designer cause them to lose their alpha channel?
2.18 Why do the XP Icons when drawn using Graphics.DrawImage not draw transparently?
2.19 Why do the XP Icons that have alpha channel not draw properly when associated with controls like ListView?
2.20 How do I prevent resizing of my Controls by the user, via Docking or anchoring or manual resizing during design-time?
2.21 What control do I use to insert Separator lines between Controls in my Dialog?
2.22 How can I make my controls transparent so the form's background image can show through them?
2.23 How do I create an editable listbox with an in-place TextBox and Button?
2.24 How do I determine the width/height of the Non-Client area (like the border in a textbox) of a Control?
2.25 How can I programmatically manipulate Anchor styles?
2.26 What is the best method to override in custom Controls to perform custom initialization during runtime?
2.27 I set a Control's Visible property to true and in the immediate next statement, it returns false. Why doesn't setting the Visible property 'take'?
2.28 I'm trying to make the background of my linklabel transparent so a picturebox will show through it. However, if I set the link label's BackColor property to Transparent the label still has a white background. Why?
2.29 How do I dynamically load a control from a DLL?
2.30 What is the (DynamicProperties) item listed on a control's property page in VS.NET?
2.31 How can I make a Panel or Label semi-transparent on a Windows Form?
2.32 How can I add a control to a Window Form at runtime?
2.33 How do I make the arrow keys be accepted by a control (such as a button) and not handled automatically by the framework's focus management?
2.34 In the property browser for a custom control, how do I disable a property initially, but enable it later based on some other property changing?
2.35 How can I have the control designer create the custom editor by calling the constructor with the additional parameters rather than the default constructor?
2.36 How do I listen to the screen resolution change in my control?
2.37 How do I determine which button in a Toolbar is clicked?

 

Windows forms FAQ