Override OnPaint
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? ...
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? ...
I find myself annoyed that Visual Studio comes with a fancy GUI interface designer and that it is only accessible to .NET applications and not even managed C++. Is there any easy way to at least open up a C DLL type interface with unmanaged/foreign code? ...
I am creating a special search text box. Among other things it have these two events: [Category("Behavior")] public event EventHandler<GenericEventArgs<string>> Search; [Category("Property Changed")] public event EventHandler<EventArgs> ActiveColorChanged; [Category("Property Changed")] public event EventHandle...
I have a somewhat complex UserControl, and Visual Studio 2008 is giving me a rather harmless annoyance when working with it. Every single time I open the control with the Designer, it decides to immediately change some of the harmless values set by the designer - namely the initialization of Size properties. If I save those changes, cl...
Hi, I have a Windows.Forms component which has a "mySize" property that returns a Size struct. My intention was to have this property calculate the returned mySize automatically based on the size of the component, unless mySize has been explicity set, in which case, return the set value of mySize. Unfortunately, now that I am embedding t...
I have a base class, defined as below (I'm also using DevExpress components): public abstract partial class BaseFormClass<R> : XtraForm where R : DataRow { ... } Contrary to what I've read from elsewhere, I'm still able to design this class. I didn't have to create a concrete class from it to do so. But, when I create a concrete cla...
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 insta...
I'm trying to see a form developed by someone else (ex-employee) in Visual Studio 2008 but keep running into the following error when I try and look at MainForm.xaml (it fails to load in the designer view): Error Could not create an instance of type 'NumericTextBox'. D:\MySolution\GUI\MainForm.xaml My solution is organised somethin...
Using Visual Studio 2008 WinForm designer, I have a container (form, panel, groupbox, whatever) and some controls in it. The container is set to not automatically resize or dock in any way. When placing a control in the container I can use the snaplines to help in positioning the control. However, the snaplines does not appear when I r...
My question is related to this question: http://stackoverflow.com/questions/93541/baseline-snaplines-in-custom-winforms-controls However, in my case, I have created a new control that derives from TextBox rather than containing a TextBox. I would like to have a custom ControlDesigner, but I would like to modify the behavior of the Text...
Hi everyone, Please help me with this. I have a custom collection class which implement ICollection, IDictionary, ... so it act as traditional List but i can raise custom event. The custom collection class has following property: - An inner list that hold values - A DataSource and DataField Then I create a Custom Control which ...
I've created a control, DataGridViewContainer, that fakes partial-line scrolling in a DataGridView - basically it's a panel and a scrollbar and a few event handlers. I'd like to be able to use DataGridViewContainer at design time, dragging a DataGridView onto it to set its .DataGridView property to the dragged control. How do I handle ...
For example, Windows Forms Designer offers to place my controls on the form the way there are 12 pixels between form border and control border. It seems too much to me. Is it standard value? Also, as I understand standard button height should be 23 pixels. Am I right? Is there any documents that state all this? And can I setup this defau...
I have created a class that is simply THIS Class UserControlBase Inherits UserControl End Class Then I changed the Inherits clause in each of my UserControls designer file to Inherits UserControlBase I know that generally you shouldn't manually mod the designer file. But in cases like this what else can you do? Is this O...
How can I hide one panel in Visual Studio 2008 Form Designer like a layer in PS? Otherwise, can someone recommend another better method to design multiple "screens" that must be clicked through by the user? ...
public class StatisticsViewPresenter { private IStatisticsView view; private Statistics statsModel; public StatisticsViewPresenter(IStatisticsView view, Statistics statsModel) { this.view = view; this.statsModel = statsModel; } } I don't use events (but am willing to if it can solve my problem), so ...
I do not wish to use compatible text rendering, but I do not wish to use Application.SetCompatibleTextRenderingDefault(false); Naturally, I thought all I had to do was set each label's UseCompatibleTextRendering property to false. The Forms Designer, however, apparently only generates code to set the property if UseCompatibleTextRend...
I have looked at the generated designer code of Forms and UserControls, 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.Resu...
It seems like a simple task. Create a C# class that derives from ToolStripButton. The derived ToolStripButton should behave exactly the same as the parent class in the designer and the application, except that the default image should be different. Surprisingly just changing the constructor is not sufficient: public CustomToolStripButt...
We have a project in our solution that houses a test application with multiple windows forms. Every time I open up a form in the form editor, Visual Studio goes out to lunch, chewing up an entire processor... until I kill the process. I tried to port over to a new project, thinking something in one of the forms, or the project file w...