99,170 questions
0
votes
0
answers
42
views
WinForms / .NETFramework: Format DataGridViewCell according to ValidationResult
Consider a small Winforms application that has a list of custom objects bound to a DataGridView.
The data class:
public class MyAwesomeClass : IDataErrorInfo, INotifyPropertyChanged
{
string _Name;...
0
votes
0
answers
98
views
WinForms DPI scaling inconsistency: child forms rescale differently than main form
I'm working on a VB.NET WinForms app (.NET Framework 4.8) and seeing inconsistent scaling between forms. I develop on my work laptop using a Remote Desktop Connection.
This problem began when I ...
0
votes
2
answers
126
views
+50
DataGridView cell painting issue on horizontal scroll
I have a DataGridView control on a Windows form, and I am using the CellPainting event to apply custom styling.
This here is my styling code:
private void dgv_CellPainting(object sender, ...
2
votes
1
answer
103
views
UserControl not visible in designer in Visual Studio 2026
We have a Winforms project:
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>
We noticed that in Visual Studio 2017 and above, any ...
-1
votes
0
answers
52
views
Winforms TabIndex order between LayoutPanels
Using Winforms, I have a UserControl with a few nested LayoutPanels (Table, Flow,etc.) to arrange the controls so that they align and stretch correctly when the control is resized. I have set the ...
0
votes
2
answers
141
views
How do I lock the size and position of an external application?
What I'm aiming to do, is to open external applications within my own WinForms application, then lock their size and position to whatever I've set it to in my program. I've been able to get them to ...
3
votes
2
answers
181
views
Visual Basic Windows Open File Dialog does not show folder panel sometimes
Inherited code that has a method for showing the System.Windows.Forms.OpenFileDialog control which works fine when called from the main form. But when called from any child form, the folder panel is ...
0
votes
1
answer
79
views
Keyboard input does not reach WebView2 when embedding a C# WinForms window inside Delphi 7 using SetParent
I am integrating a modern web interface into a legacy Delphi 7 desktop application by hosting a C# WinForms executable that uses WebView2.
The C# application works correctly when run standalone. ...
0
votes
1
answer
160
views
Change Button.Text property to a custom value in C#
public Button()
{
this.Size = new Size(100, 100);
this.ForeColor = foreColor;
this.BackColor = BackColor;
this.Text = "Hello";
}
I created this constructor class to ...
Best practices
1
vote
3
replies
171
views
.gitignore for .NET MAUI and WinForms projects
I'm new C# dev and already got some problems with binary files, long paths, sometimes corrupting files and also GitHub versioning.
Do you know some good practices with .gitignore and versioning that ...
0
votes
0
answers
59
views
How to pass value to dynamic form [duplicate]
I need to solve passing value with dynamic form, below is the explanation
MainForm with menu and status bar on bottom side of windows. The status bar (lbBulkForm) indicate active form and (...
0
votes
0
answers
80
views
DataGridView filter refuses to show empty table and keeps showing the last row
I have a checkbox filter for my datagrid table - a pretty simple one: [Account] IS NULL.
It works off checkbox "unassigned" that when pressed filters to show only unassigned rows. The ...
-1
votes
1
answer
121
views
How to draw a scalable checkmark inside a custom WinForms Button using OnPaint?
I'm creating a custom circular button in WinForms. I can successfully draw the circle using DrawEllipse. However, I don't know how to calculate the correct proportional coordinates to draw a scalable ...
0
votes
0
answers
62
views
WinForms Form icon changes to EXE icon when positioned beside taskbar overflow (Windows 11)
In a VB.NET WinForms application (.NET Framework 4.0) running on Windows 11, a specific icon switching behavior occurs when the taskbar becomes crowded.
Here is my code snippet:
Public Class Form1
...
1
vote
1
answer
193
views
Draw *thin* border between cells in TableLayoutPanel
I want to control whether there is a border line between the cells in a TableLayoutPanel, much like I can do in an Excel table.
To begin with, I set my CellBorderStyle to None as suggested in Draw ...