windows-forms-designer

C#: Does ResumeLayout(true) do the same as ResumeLayout(false) + PerformLayout()?

寵の児 提交于 2020-05-12 11:34:30
问题 I have looked at the generated designer code of Form s and UserControl s, and in the InitializeComponent() method they always start with this.SuspendLayout(); and end with this.ResumeLayout(false); this.PerformLayout(); But from what I can see in the msdn documentation of those methods, wouldn't ending with this.ResumeLayout(true); // Or just this.ResumeLayout() do the exact same thing? Or am I missing something here? Asking because I will be adding a bunch of controls in a different method,

Generate code or events when drag-drop a custom control from the toolbox

耗尽温柔 提交于 2020-03-03 10:15:09
问题 I'm creating a custom control (e.g custom LookUpEdit) and I'm wondering if I can generate code (e.g EditValueChanged event in form.cs file or some rows of code e.g in Form_Load event) automatically while I drag and drop this control inside a form designer, giving this way to any developer the opportunity to easily see and extend this code if he/she wants. My question is: How to generate code or events automatically in a form (form.cs) when you drag-drop a custom control from the toolbox at

User control containing child control, deisgn mode edit child control

此生再无相见时 提交于 2020-02-24 12:28:05
问题 I have a control, within that control there is a collection of other controls (a bit like a tab control - but not a tab control). So I have my control on a form. I can add new child controls using a custom collection designer form, no problem. I would like to be able to add controls to the child control in design mode from the form view. At present if I select the child control and drop say, a checkbox, the checkbox gets added to the parent control not the child control and then sits over the

Keeping Adorner Glyphs On Top for Selected Control in Winforms Designer

寵の児 提交于 2020-02-07 02:00:48
问题 TLDR: I'm seeking the correct method for timing the rendering of a juxtaposed graphic for a particular control on a design surface so that the graphic always is painted ahead of the adornment glyphs when that control is selected. This question concerns control designers for Winforms: When the user places a control on the design surface, I want to display a graphic above the client area of the control. I have succeeded to some extent doing that for a TableLayoutPanel (TLP) control by

Keeping Adorner Glyphs On Top for Selected Control in Winforms Designer

走远了吗. 提交于 2020-02-07 01:59:29
问题 TLDR: I'm seeking the correct method for timing the rendering of a juxtaposed graphic for a particular control on a design surface so that the graphic always is painted ahead of the adornment glyphs when that control is selected. This question concerns control designers for Winforms: When the user places a control on the design surface, I want to display a graphic above the client area of the control. I have succeeded to some extent doing that for a TableLayoutPanel (TLP) control by

How do I get the Windows Forms Designer to use resources from external assembly?

不羁的心 提交于 2020-01-29 13:02:12
问题 I have some resources (images in this case) in a resource file that I use on controls in my Windows Forms project. The Visual Studio Resource Selection dialog doesn't have very good support for choosing images from resource files unless they're in specific locations, but you can edit the designer file directly, and this works just fine; the application compiles and runs correctly, and the Windows Forms Designer is smart enough to not mess up my hand-edited code. // in an assembly named

How do I get the Windows Forms Designer to use resources from external assembly?

橙三吉。 提交于 2020-01-29 13:02:05
问题 I have some resources (images in this case) in a resource file that I use on controls in my Windows Forms project. The Visual Studio Resource Selection dialog doesn't have very good support for choosing images from resource files unless they're in specific locations, but you can edit the designer file directly, and this works just fine; the application compiles and runs correctly, and the Windows Forms Designer is smart enough to not mess up my hand-edited code. // in an assembly named

Hosting Windows Forms Designer - Serialize designer at runtime and generate C# code

情到浓时终转凉″ 提交于 2020-01-21 09:11:25
问题 I am creating a designer surface and loading the controls to a runtime. I am having issues when deserializing/loading the controls to the runtime. All methods I have tried seem to have some type of issue. Issued faced for example: Controls are still bound of the design-time Not all properties deserialize with all the properties, namely nested properties. Control associations does seem to be followed, i.e. Button in a Panel, will not be in the panel anymore, even though the property is still

How do I control the focus order for TextBoxes inside a panel?

一世执手 提交于 2020-01-21 06:37:11
问题 I have a Form with many TextBoxes. I need some TextBoxes inside one group, and other text boxes inside another group. By group, I just need a way to make these TextBoxes appear to belong with each other. I made two Panels and added the TextBoxes to them. Then, I placed a border around these Panels. However, my problem is that when I press Tab , the focus doesn't go to the next TextBox, but rather it goes in a random order to another TextBox. Sometimes the next TextBox is inside the first

How does the Winforms Designer instantiate my form?

夙愿已清 提交于 2020-01-21 05:20:07
问题 I'm developing my own WinForms designer. It must be able to load existing custom form types. One of the issues I hit is forms without a default ctor: My code currently instantiates the form before it can load it into the designer, which requires a default ctor. OTOH, VS2008 is able to load such forms. I believe it doesn't actually instantiate my form (as noted in this question): Even default ctors are not executed. And it doesn't truly execute InitializeComponent(). I just added a messagebox