windows-forms-designer

Editing the InitializeComponent() method C#

北战南征 提交于 2020-01-17 04:46:06
问题 I've gone through multiple resources on trying to find the use cases of when to manually add code to InitializeComponent, but haven't found anything concrete. This suggests we shouldn't do it - The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified In the past, I had always used the form designer and never needed to manually make changes to InitializeComponent(). However at my new firm, the tech lead has completely ignored the form

Redistributing a WinForms component with design-time functionality in a separate DLL without admin rights

半腔热情 提交于 2020-01-16 07:52:31
问题 I am trying to modify the installation package for one of our legacy WinForms component. The goal I want to achieve is to avoid elevating privileges and do all works without admin rights. The problem is that the component is implemented in two DLLs - the core functionality redistributed with compiled apps and the design-time functionality needed only for the WinForms designer. To provide all design-time features of the component, VS should "know" how to find the design-time DLL. Earlier we

How to properly mark designer code for code metrics to ignore it

梦想与她 提交于 2020-01-15 08:58:09
问题 I marked all instances of InitializeComponent with <CodeDom.Compiler.GeneratedCode("WinForms Designer", "")> So those will not show up during code metrics analysis. The rest of the generated code is still considered mine, particularly setters and getters for each control. Marking the whole partial class (the winforms designer part) with GeneratedCode makes the whole class disappear from code metrics, so even my custom logic. I am using Visual Studio 2010. 回答1: Code Metrics does not ignore

ZedGraph MajorGrid and MinorGrid LineStyle

旧城冷巷雨未停 提交于 2020-01-15 03:39:27
问题 I just wonder if anyone knows how to change the LineStyle of the Major and Minor grid for a ZedGraph? For example I have: graphPane.XAxis.MinorGrid.IsVisible = true; I want something along this line: graphPane.XAxis.MinorGrid.LineStyle => solid line. I've done a lot of research today but could not find the answer. Thank you in advance for your time. 回答1: You probably have autoscaling set to true if you switch this off you can then set steps which you wish to use its best to stick with some

Hide private child control property at design time

孤者浪人 提交于 2020-01-14 10:07:57
问题 I have a container control with some private child control. How to hide the property browser from showing the control at design time. also it shows a lock and a square icon on each of the control at design time. I tried to set for the control <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Bindable(False)> <EditorBrowsable(EditorBrowsableState.Never)> also tried to set <DesignTimeVisible(False), ToolboxItem(False)> for the child control. but still

Hide private child control property at design time

落花浮王杯 提交于 2020-01-14 10:07:30
问题 I have a container control with some private child control. How to hide the property browser from showing the control at design time. also it shows a lock and a square icon on each of the control at design time. I tried to set for the control <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Bindable(False)> <EditorBrowsable(EditorBrowsableState.Never)> also tried to set <DesignTimeVisible(False), ToolboxItem(False)> for the child control. but still

VS Designer error: GenericArguments[0], 'X' on 'Y' violates the constraint of type parameter 'Z'

佐手、 提交于 2020-01-14 08:08:12
问题 I am trying to create forms that inherit from a "generic" base class where the generic argument of that base class has a constraint that it must implement one of my interfaces. It compiles and runs just fine. My problem is with the Visual Studio designer. It will open the form fine until I rebuild the project, after which it then reports the error below when trying to view the form designer until such time as I either restart Visual Studio, or remove the custom interface constraint in the

In form numberpad C#

好久不见. 提交于 2020-01-14 06:47:46
问题 I would like to add an in form numberpad to my form to make the program more touch friendly. I have multiple text boxes on this form that change focus when the enter key is pressed. I tried SendKeys.Send("#"), but when I click the button it just changes focus to the button and does nothing inside the text box I was trying to type in. Is there a guide or something for this? I have looked and all I can find are on screen keyboards that work outside of the form, but not inside. 回答1: Expanding a

Where does Visual Studio look for assemblies?

半世苍凉 提交于 2020-01-12 19:28:09
问题 I've got a framework which consists of many base classes that can be derived to develop many apps. Among these classes there is a subclass of System.Windows.Forms.Panel for which I wrote its own designer. Everything is working fine with Visual Studio 2005, but something goes wrong when I try to move to VS2010. This is a much simplified version of what I am doing: I have a project called CoreClasse which contains an interface and two classes: public interface IConf { string foo { get; set; }

Where does Visual Studio look for assemblies?

白昼怎懂夜的黑 提交于 2020-01-12 19:27:01
问题 I've got a framework which consists of many base classes that can be derived to develop many apps. Among these classes there is a subclass of System.Windows.Forms.Panel for which I wrote its own designer. Everything is working fine with Visual Studio 2005, but something goes wrong when I try to move to VS2010. This is a much simplified version of what I am doing: I have a project called CoreClasse which contains an interface and two classes: public interface IConf { string foo { get; set; }