designer

Microsoft Visual Studio and C#: How to Visually Add Events to Controls?

↘锁芯ラ 提交于 2019-12-17 07:48:19
问题 Perhaps this is a stupid question, but for the life of me I cannot find a way to do this. How would one go about adding an event handler to a control in a form in Microsoft Visual Studio (2008) with C#? I can do it manually, but opening the Designer.cs file for the Form, but I cannot find a way to do it through the interface. In MSVC 6, with C++ and MFC, you could right click or some other action, and find a list of all the possible events for that control. Then you select it and it would

What approaches are available to dummy design-time data in WPF?

非 Y 不嫁゛ 提交于 2019-12-17 04:40:14
问题 I am working without expression blend and just using the XAML editor in vs2010. The wisdom of this aside, I am increasingly seeing a need for design-time data binding. For simple cases, the FallbackValue property works very nicely (Textboxes and TextBlocks, etc). But especially when dealing with ItemsControl and the like, one really needs sample data to be visible in the designer so that you can adjust and tweak controls and data templates without having to run the executable. I know that

How to let C# designer edit my struct property?

一笑奈何 提交于 2019-12-14 01:28:05
问题 I am creating a custom Windows Forms control in C# with several custom properties. One of those properties is a simple struct with several integral fields: public struct Test { public int A, B; } Test _Test; [Category("MyCategory")] public Test TestProperty { get { return _Test; } set { _Test = value; } } I want the Visual Studio designer to edit the fields of my structure the same way as it does for Size , Margins and other similar Windows Forms structures. Do I need to implement a custom

Visual Studio designer moving controls and adding grid columns when form is opened

跟風遠走 提交于 2019-12-13 17:30:04
问题 The first time I try to open a particular form many of the controls (those with anchors on the right side and/or the bottom) are shifted and my grids automatically regain all the columns from their datasource which (the columns) I had previously removed. I have read elsewhere it is recommended to copy the 'good' designer code into the constructor after the InitializeComponent method. This doesn't seem to be a good long term solution, eg what if a user makes future design changes? Any

Override OnPaint

﹥>﹥吖頭↗ 提交于 2019-12-13 14:43:08
问题 If I override OnPaint and draw a square on the control, how do I get that e.graphics.draw... to show up when I'm previewing it in the designer? 回答1: http://msdn.microsoft.com/en-us/magazine/cc164048.aspx http://msdn.microsoft.com/en-us/magazine/cc164145.aspx While you could manually register with Control.OnPaint to add your design time UI, you'll find that overriding OnPaintAdornments is a better option because it is only called after the control's design-time/run-time UI is painted, letting

Visual Studio WinForms designer does not instantiate object

落花浮王杯 提交于 2019-12-13 12:29:52
问题 I created a class derived from System.Windows.Forms.ContextMenuStrip class, not as a user control, just a plain .cs class with a constructor and one event handler. When I drag this class from the Toolbox onto the designer, it creates a private member for it and a couple of properties, but does not instantiate an object. Thus, at runtime I get "Object reference not set to an instance of an object.", because the designer never generates the line: this.searchGridContextMenu1 = new

Invalid Resx file. Could not load type error why?

99封情书 提交于 2019-12-13 12:29:12
问题 I'm getting designer error on code: The Component i'm willing to define a List of properties for: using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; namespace TestProjectForProperty.Test { public class MyTreeView : TreeView { private List<TypeDescriptorBase> _descriptorsAvailable = new List<TypeDescriptorBase>(); [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public List<TypeDescriptorBase> DescriptorsAvailable { get { return

How to refrence an object created by Desginer [duplicate]

女生的网名这么多〃 提交于 2019-12-13 09:02:56
问题 This question already has answers here : Textbox Object Reference [closed] (2 answers) Closed 6 years ago . (I'm using default Visual Studio names) How can I reference a texbox object(texbox1) in another custom class in form1.cs file(a class within "public partial class Form1 : Form") here is my code. In myclass I've written textBox1, but intelisense didn't suggest it to me. I mean. what can I do to make texbox1 show up in intelisence in this situation? changing private to public in form1

hiding a field using Openerp report designer

核能气质少年 提交于 2019-12-13 04:43:43
问题 I am using OpenERP report designer to alter the sales order report a bit. Background: I am trying to remove the internal reference of a product that appears in my invoices, sales orders and quotations.... Actions done: I have created a new field through the delevoper mode and named it x_showintref which is a boolean ('x_showintref': fields.boolean('Show Internal Reference'))... What to do: I am trying to edit the sales - quotation report so that when the x_showintref is ticked, it will

How to facilitate Netbeans Designer to load JPanel-s that use an enum reverse-lookup using hashmap?

核能气质少年 提交于 2019-12-12 23:13:52
问题 This has become a Dorothy Dix as I found the root of the matter while I was composing this question. Nevertheless, I decided to post it because it had everyone in our office stumped and I could find nothing helpful in the google or stackoverflow searches. This is a good example of once you ask the right question, you may see the light. While the title might sounds complicated, it is a really simple problem that seemed to have no answer. At the centre of this is an enum : Status public enum