Condividi tramite


Odds and ends from the world of design-time

I've fixed a couple of doc bugs that customers were rightfully complaining about. It will be awhile before you'll see the updated topics, so here's a summary to give you a head start.

How to: Give Your Control a Transparent Background 

Several customers have discovered that the given procedure simply doesn't work. In fact, the procedure does work. The problem is that "transparent" in Windows Forms doesn't mean what you might think. Follow the procedure in the topic, then assign a background bitmap to the hosting form. Suddenly you'll see the control with the "transparent" background painted with the form's background.

"Transparency" in Windows Forms means that the parent paints the background of the child. You might call it "pseudo-transparency." I added a note to the topic which explains this.

How to: Provide a Toolbox Bitmap for a Control

Customers have also noticed that this procedure doesn't seem to work. The issue is that bitmaps do not appear in the Toolbox for autopopulated controls and components. To see the bitmap, reload the control by using the Choose Toolbox Items dialog box. See Walkthrough: Automatically Populating the Toolbox with Custom Components for details.  

EditorBrowsableAttribute Class

An interesting feature of the C# Code Editor in VS is that when you mark a member with EditorBrowsableState.Never, IntelliSense suppresses that member only if it's from an assembly that isn't built in the current solution. 

Component.Dispose 

I'm occasionally asked if there's anything more to be said about the Dispose method for components, i.e. , classes which implement the IComponent interface. In short, no. Component is a simple class, and although it participates in the relatively complex design-time, there are no special considerations for component authors to take into account for Dispose implementations.