250 questions
117
votes
5
answers
86k
views
Transitioning from Windows Forms to WPF
For a long time now, I have been stuck with Windows Forms development (started with VB6, and has continued through to C# .NET 4.5), and I have pretty much hit the limit of what Windows Forms can do, ...
8
votes
2
answers
17k
views
Can't view designer when coding a form in C#
I'm following this tutorial on winforms, and so far the tutorial is coding the form without using the toolbox. I believe it'll introduce the toolbox in more depth shortly.
Following the tutorial, I'...
31
votes
3
answers
15k
views
Combining multiple Attributes to a single Attribute - Merge Attributes
On a control I am using multiple attribute properties:
[Browsable(false)]
[Bindable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[DesignerSerializationVisibility(...
3
votes
2
answers
763
views
How to find overlapping controls that I added to form?
I've simply added a control to my form and now I can't even see it on the form. But it is still there. How can I find it?
6
votes
1
answer
2k
views
UserControl with header and content - Allow dropping controls in content panel and Prevent dropping controls in header at design time
I wrote User Control (yay!). But I want it to behave as a container. But wait! I know about
[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design",
typeof(IDesigner))]
...
107
votes
10
answers
33k
views
How can I get Visual Studio 2008 Windows Forms designer to render a Form that implements an abstract base class?
I engaged a problem with inherited Controls in Windows Forms and need some advice on it.
I do use a base class for items in a List (selfmade GUI list made of a panel) and some inherited controls that ...
40
votes
3
answers
17k
views
Generic base class for WinForm UserControl
I created a generic base class for a WinForm UserControl:
public partial class BaseUserControl<T> : UserControl
{
public virtual void MyMethod<T>()
{
// some base stuff ...
6
votes
8
answers
10k
views
Windows Forms Designer and WPF Designer for .NET Core
I have recently heard that the alpha version of .NET Core (.NET Core 3.0) supports Windows Forms and WPF. But the Visual Studio Designer (and Visual Studio) doesn't support the .NET Core version of ...
2
votes
1
answer
3k
views
Show controls added programmatically in WinForms app in Design view?
Using Visual Studio (any version will do), is it possible for controls added programmatically (rather than via the Design view) to then be shown when switching back to the Design view?
I've tried ...
2
votes
3
answers
3k
views
Displaying a collection of controls in Windows Forms
I want to display something like the following :-
Each row is about a process (information like PID, Parent etc.). User can check the checkbox and click Launch button to get some dynamic details about ...
5
votes
1
answer
2k
views
Custom browsable property for Form at design time
I want to make a custom property for a windows form browsable during design-time but none of my efforts have panned out to success. The obvious solution would seem to be to set the browsable attribute ...
2
votes
1
answer
2k
views
Where is the Visual Studio 2017 Winforms Designer cache?
I'm getting some annoying errors from Visual Studio Designer when trying to open one of my forms (Could not load type x from assembly y, even though assembly y clearly contains type x; the project ...
1
vote
1
answer
598
views
How can I keep a Status Bar from covering my RichTextBox?
there! I am creating a Notepad-Like program (much more advanced) and there is something bothering me...
Notepad++ & Notepad have the Status Bar located just under the RichTextBox/TextBox border. ...
-1
votes
1
answer
1k
views
Having trouble with set-up of Windows Forms appication (VB.NET) in Visual Studio
I have been asked to work on a piece of software. I am an intern developer and there are no other developers at this company. I was given a folder of C# source code that includes other folders as well ...
38
votes
5
answers
114k
views
Reportviewer tool missing in visual studio 2017 RC
I just started to write reporting software in new version of visual studio named visual studio 2017 RC but just noticed that core reportviewing tools is missing from both windows forms and WPF ...
17
votes
4
answers
87k
views
How to make a DataTable from DataGridView without any Datasource?
I want to get a DataTable from DataGridView of the Grid values.
In other words DataTable same as DataGridView Values
9
votes
2
answers
18k
views
Custom Color Palette in Visual Studio Color Property Editor
Within the Visual Studio Designer, under the properties window you are able to select the ForeColor, BackColor etc using color picker. When you want to pick a color, a color picker comes up with the ...
6
votes
4
answers
3k
views
Prevent Winforms Designer from Generating Property Values for Inherited Controls
I have a custom DataGridView, let's say as such:
public MyGridView : DataGridView
{
public MyGridView()
{
BackgroundColor = Color.Red;
}
}
Now, when I use this control in a ...
6
votes
1
answer
5k
views
How to set text to a control from resource file in design time?
I want to know if there exists a way to set a control's Text property from a resource file in design time:
Or this process can only be performed programatically?
1
vote
1
answer
1k
views
Is there a way to auto generate controls on a form from a binding source?
When I add a binding source to my windows form, is there a quick way to populate the form with all the properties of the bound object?
A drag and drop Field List, similar to that found in many report ...
9
votes
5
answers
13k
views
How to debug winforms designer
My question is not how to debug during design time. I actually want to debug through the events available in designer. I know that the form has load and other type of events. Is there any events in ...
6
votes
1
answer
2k
views
Expose Columns property of a DataGridView in UserControl and make it editable via Designer
Short description:
I have a UserControl with a DataGridView on it. I
want to expose the DataGridView Columns collection to the designer, so
I can change the columns on my User Control at ...
5
votes
2
answers
8k
views
Click event for .Net (Windows Forms) user control
This is probably a very simple question, but for some reason, even the right way to web search for the answer eludes me...
I'm trying to create a user control that consists of a few labels and ...
5
votes
1
answer
372
views
Why should I insert a non-UI Windows.Forms component from the designer?
In C# (and Visual Basic) you can add several non-UI components (those that don't inherit from System.Windows.Forms.Control) directly from the form designer. Examples of those components are System....
1
vote
1
answer
444
views
Too many <?xml in one Xml file
I was finally able to create a Xml file with some coding (with lots of help here from some people). I can store the file but the next process is reading it back. This gave me an error:
"...
1
vote
1
answer
1k
views
Chart x-axis maximum value not being set correctly
I currently have a chart on my C# Windows Form Application (in Visual Studio 2013) that gradually draws a line onto it using a timer. I have tried to set the minimum and maximum values for the x- and ...
38
votes
6
answers
19k
views
Disable designer in Visual Studio?
I'm using Visual C# Express to write Windows Form applications, and call me old school, but I don't like the designer. It is a nuisance and pollutes my project with lots of unwanted files, as well as ...
35
votes
5
answers
7k
views
Baseline snaplines in custom Winforms controls
I have a custom user control with a textbox on it and I'd like to expose the baseline (of the text in the textbox) snapline outside of the custom control. I know that you create a designer (inherited ...
26
votes
5
answers
100k
views
How do I get which radio button is checked from a groupbox?
I have these groupboxes:
I want to run some code according to checked true state of a radio button like:
string chk = radiobutton.nme; // Name of radio button whose checked is true
switch(chk)
{
...
21
votes
2
answers
35k
views
Allowing javascript to run on a windows form web browser
I want to use a Web Browser to access a website that uses JavaScript on load. I understand that Web Browser is a wrapper of the current installed version of Internet Explorer. However, testing the ...
15
votes
11
answers
6k
views
Handcode GUI or use gui-designer tool [closed]
I would like to hear some opinions on hand coding your GUIs as one typically do when using Java or Qt with C++, vs using a gui-designer tool? Examples of GUI designer tools would be MFC GUI-designer, ...
10
votes
1
answer
12k
views
How to set FlowLayoutPanel contents at Center of Form
I have a few Button controls in a FlowLayoutPanel, and I want to set them precisely at middle bottom of Form.
In the image below I set the Button precisely at middle by setting the FlowLayoutPanel ...
10
votes
5
answers
46k
views
Embed a form onto a tabcontrol in windows forms
I have a tab control in a windows form and I want to be able to click on a tab and in the body area of the tab I want it to display another form as an embedded component. Is this possible? If so, can ...
7
votes
7
answers
12k
views
How do I keep Visual Studio's Windows Forms Designer from deleting controls?
With several forms of mine, I occasionally run into the following issue: I edit the form using the designer (Visual Studio 2008, Windows Forms, .NET 2.0, VB.NET) to add components, only to find out ...
6
votes
1
answer
2k
views
Abstract generic UserControl inheritance in Visual Studio designer
In one of my projects I'm using an abstract UserControl. To be able to design this control in Visual Studio I'm using the code proposed in this answer. Now I want to use this with another abstract ...
5
votes
2
answers
3k
views
Windows Forms Generic Inheritance
I have these classes:
class Foo<T1, T2> : Form
where T1, T2 : EventArgs
class MiddleGoo : Foo<X,Y>
class Goo : MiddleGoo
X,Y are just simple classes derived from EventArgs.
I see ...
4
votes
1
answer
7k
views
Visual Studio 2022 winform designer does not show ApplicationSettings in the property window of any control
In VS 2022 I create a new winform (.net 6.0) project. I put one textbox on the form. In the properties window, at the top, I'm used to seeing an item "ApplicationSettings" where I can bind ...
4
votes
2
answers
2k
views
How to get WinForms custom control's default value to be respected when first dropped on a form
I have a class library with a custom control in it:
using System.ComponentModel;
using System.Windows.Forms;
namespace ClassLibrary1
{
public sealed class CustomLabel : Label
{
[...
2
votes
1
answer
1k
views
User Control Property that shows a list of all Forms at design time
As we all know Forms created with Form.cs file
I have property of type Form
example : public Form TargetForm {get;set;}
i don't need to use Activiator.CreateInstance() to create Form
I just need to ...
2
votes
1
answer
2k
views
WinForms Designer and TableLayoutPanel SmartTag Customization
I am trying to customize the existing Smart Tag content for a TableLayoutPanel Windows Forms control for use in the Windows Forms designer (I implemented a designer that leverages the WinForms ...
2
votes
1
answer
1k
views
WinForms designer properties of different derived types
Say I have a particular type that I want to make available to the Windows Forms designer...
public class Style
{
public CustomBrush Brush { get; set; }
}
And CustomBrush is implemented like so...
...
1
vote
2
answers
5k
views
Set the default value of DesignerSerializationVisibility to hidden
Is there a way to set the a default value for the attribute DesignerSerializationVisibility for all the properties of a given class?
In practice, a way to switch the default behavior of black-listing ...
0
votes
2
answers
921
views
TextBox with dotted lines for typing [closed]
I want to create a dotted lines that is used as input for typing text on it instead using a text box.
For example:
Instead of text box:
I want to make something like this:
and to be able to type on ...
0
votes
2
answers
334
views
Parsing UnregisterHotkey from usercontrol to parent form
So I'm attempting to get the userinputs when someone presses hotkeys, also outside the form (in this case SHIFT+A). Now since I wanted to add tabs to my forms application I decided to go with ...
50
votes
16
answers
55k
views
The variable 'variable_name' is either undeclared or was never assigned
I have a question related to the error on the title. Im working with c# and Visual Studio 2010.
I have a form declared as "public class FormularioGeneral : Form", which is the base for the rest of ...
40
votes
2
answers
82k
views
Zooming in the visual studio form designer
I'm using the Visual Studio 2013 form designer to edit a form. The size of the form in the designer window is too big so I want to zoom out.
In applications like Photoshop or Blend I could (among ...
38
votes
2
answers
20k
views
How to avoid error "Constructor on type 'MyType' not found" when inheriting a base class
I have a Visual Studio 2010 Windows Forms app which includes a Form base class that other classes will inherit. The base class' constructor takes a parameter that the child classes will pass to the ...
21
votes
6
answers
9k
views
Why does C# designer-generated code (like Form1.designer.cs) play havoc with Subversion?
My workshop has recently switched to Subversion from SourceSafe, freeing us from automatic locks. This led to concurrent editing of the Forms, which is wonderful. But when multiple developers commit ...
21
votes
1
answer
12k
views
Why do my forms look like 'Windows Classic'?
Is there any free tool to style my C# Windows Forms, to make them look like Windows 7 Windows.
**EDIT**
In the designer mode, I have this :
But when I run I get this :
I don't know why I get that. (...
19
votes
3
answers
41k
views
Windows Forms application option seems to be missing?
I'm learning how to design a Windows Forms Application in Visual Studio 2017. The tutorial asks me to create a new project using the File -> New -> Project option and selecting 'Windows Forms ...