99,234 questions
1
vote
1
answer
90
views
DragDrop Copy effects with PictureBoxes? Is it making an actual copy of the source file?
I'm currently trying to create a simple drag-drop effect using pictureboxes. It works perfectly fine; however, I'm then trying to deduce the drop target's resource file in order to know if it needs to ...
-1
votes
0
answers
67
views
Drawing paths between Controls that do not intersect each other and don't overlap
I've been trying for a while to come up with a solution for drawing paths between controls that do not intersect or overlap each other, but it seems like I'm out of ideas. I have tried using MSAGL 1.1....
0
votes
2
answers
109
views
Button won't enable on conditions set in the TextChanged event handler
I have written some code that is designed to enable or disable a Button, depending on what some TextBox Controls contain.
For some reason, the Button won't re-enable after it gets disabled. Sorry for ...
1
vote
0
answers
91
views
WPF Modal Window renders completely white (blank) in Hybrid WinForms application under load
I am maintaining a legacy hybrid application (Main App is WinForms, hosting WPF UserControls via ElementHost).
The Problem:
When opening a WPF Modal Window (Window.ShowDialog()) from the WinForms main ...
Advice
0
votes
0
replies
45
views
WinForms application - Form Designer - Can't reach this page - Visual Studio 2022 or 2026
I have a older project - WinForms application - and after update of Visual Studio (update 2025) I had a problem to display Forms in both versions of Visual Studio: 2022 and 2026.
Form designer just ...
Best practices
0
votes
6
replies
131
views
Need Help to solve a scenario
I'm developing a WinForm application which will used in several companies in the same holding. There is a network connection between them.
The scenario which I want to implements is:
Company A will ...
0
votes
0
answers
132
views
Winforms panel not redrawing rectangles properly
I am trying to create a tile editor in Winforms. Therefore, I have this code to draw rectangles across my panel:
private void panMain_Paint(object sender, PaintEventArgs e)
{
Graphics g = e....
0
votes
0
answers
85
views
How to remove "Inheritance Hierarchy", "Syntax", and "See Also" sections in SHFB? I need user-style documentation
I'm using Sandcastle Help File Builder (SHFB) to generate documentation.
I am not creating technical API documentation — I want to create user documentation (with images and descriptions), similar to ...
1
vote
1
answer
154
views
How do I fill the rectangle with a color
private SolidBrush b;
private Graphics g; //Encapsulates a GDI+ drawing surface
Pen p = new Pen(Brushes.DeepSkyBlue); //Pens are used to draw objects
...
Tooling
0
votes
5
replies
94
views
c# windows form passport size photo image background change
Any samples for C# Windows Forms passport size photo image background changer.
Bitmap bitmap
for (int y = 0; y < bitmap.Height; y++)
{
for (int x = 0; x < bitmap.Width; x++)
{
...
5
votes
4
answers
314
views
How to force the Application.Run to wait for all async void handlers?
I have a Windows Forms application and a Form with many async void event handlers. This form can be closed by the user at any moment. After closing the form I want to delete a temporary file, and my ...
-1
votes
0
answers
96
views
Datagridview does not show any data
I have a datagridview in my Winforms app. I set the columns manually in designer and then try to fill it by a function. I check the function step by step and in the last line of code datasource dt has ...
1
vote
1
answer
113
views
Highlighting the datagridview rows
I have a datagridview in my Winforms app with .NET 8. I want to highlight some rows based on the current user role and the request nextlevel. I write this function and call it in form load.
But at the ...
-1
votes
0
answers
107
views
Purple outline with WinForms transparent image and text
I am currently working on a little project (like the game Bongo Cat) and I ran into a problem with how the transparent image (a PictureBox) renders with the transparent part. (Also the same with the ...
Best practices
0
votes
3
replies
120
views
How to avoid that a user control changes its size when placed in tab page?
Problem: the user control's size changes when placed on the tabpage
What I tried: unset anchoring in the user control's children properties, but it didn't help.
The user control designer class:
...
0
votes
1
answer
206
views
How to set window position on different monitor from main window
It's no problem to set the position of the new WinForm inside the monitor where the main window is displayed. For example:
Form1 form = new Form1();
form.Show();
form.StartPosition = FormStartPosition....
-1
votes
1
answer
85
views
Windows App Forms - System.AccessViolationException Error
I m facing a System.AccessViolationException issues during executing an SSIS package using C#.
I have a parent windows form where i ask the user if he would like to proceed and if so, the parent form ...
0
votes
1
answer
119
views
Changing the version of an assembly reference is not allowed during debugging
I get this error:
Failed to emit module 'xyz': Changing the version of an assembly reference is not allowed during debugging: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=...
0
votes
2
answers
105
views
User control wouldn't inherit events any more [closed]
This problem is related to the creation and use of a user control in WinForms. At first, when I found online tutorials, I created a user control library. The first attempt was to modify a checkbox ...
0
votes
0
answers
126
views
How to see a Winforms custom control in Visual Studio designer?
I am following this tutorial to create a custom control that inherits from one different than UserControl.
When opening the designer view of this control, instead of seeing a render of the control, I ...
0
votes
1
answer
153
views
Why do Images leave giant piles of RAM behind them? [closed]
I am currently working on a .NET 9 WinForms program that contains an ImageViewer, which is a seperate window where you can scroll through a series of images.
My problem is that even after closing the ...
1
vote
0
answers
162
views
Text DPI scaling difference between .NET Framework 4.7.2 and .NET 9
There seems to be a subtle difference in appearance between .NET Framework 4.7.2 and .NET 9 when scaling text with the DPI.
I made a small DPI-aware test project which compiles to .NET Framework 4.7.2 ...
0
votes
0
answers
142
views
FastReport.NET – PageHeaderBand not repeated on multipage TableObject
I'm working with FastReport.NET in a WinForms project and I have a TableObject that spans across multiple pages. (No datatables, no report definitions)
The table is generated correctly and page breaks ...
3
votes
1
answer
177
views
how would I skew a Windows Forms texture/image so that one side is smaller/bigger than the other side to have a "pinched" look to it
(I am aware using windows forms for this kind of project is stupid and inefficient but it is a requirement for the college course I'm doing so I'm stuck using this)
in windows forms you can draw an ...
0
votes
0
answers
57
views
Is it possible in WinForms to set to Bold Forms Header text? [duplicate]
I would like to know if there is a way to set the Header of form text to Bold.
the property Form.Text is set but can i make it bold?
I want the Form1 in the picture example to be in Bold.
I tried to ...
-1
votes
1
answer
77
views
"System.IO.Ports is currently only supported on Windows." on .net 8.0 / Raspbian
i am trying to run a .net 8.0 application on Linux / Raspbian with System.IO.Ports, i have done this previously with the same setup with no issues.
This time i am getting this exception when running ...
0
votes
2
answers
199
views
C# : overriding listview view property
I'm trying to override the View property in a derived class from Listview:
public class CustListview : System.Windows.Forms.ListView
{
private CustView mView = new CustView();
public enum ...
0
votes
0
answers
76
views
Why elements in my winform do not resize?
I am maintaining an old Winforms application and one of the form was extremely small compared to the other forms.
I have changed the size of the forms, changed the size of the panel which contains all ...
1
vote
3
answers
551
views
MethodAccessException with the new Microsoft.Ink.dll from Windows 11 24H2
The situation is that Microsoft.Ink.dll in Windows 11 24H2 has been recompiled with .NET Framework 4.5, overwriting the same 6.1.0.0 version tied to .NET Framework 2.0. As you can see in the image the ...
0
votes
1
answer
107
views
VB.NET DataGridView not showing label row with EmpId and EmpName before attendance rows
What are you trying to do?
I'm building an attendance summary grid in VB.NET (Windows Forms). For each employee, I want to insert a label row before their daily attendance rows. This label row should ...
0
votes
1
answer
81
views
How can I drag the column width of a DataGridView on the designer page when using a custom designer with DesignSurface in a Windows Forms application?
I am currently using DesignSurface to create a custom designer. I want to enable dragging the column widths of a DataGridView on the designer page and record the changes, similar to how it works at ...
1
vote
0
answers
186
views
Visual Studio 2022 WinForms resources "missing" (but they aren't)
I used to be a developer and software engineer but I've been retired for 15 years now so I'm a bit rusty and not up to speed on the latest stuff.
Fired up Visual Studio 2022 for the first time in a ...
0
votes
2
answers
272
views
Can the TextBox portion of a ComboBox be made resizeable on all sides?
Can the TextBox portion of a ComboBox be made resizeable on all sides?
I've done this with the TextBox (shown below). I thought the ComboBox was a composite control with a TextBox & ListBox, so I ...
-1
votes
1
answer
144
views
ComboBox using C# Microsoft Visual Studio appears empty when I run the .exe
I'm currently working with DataGridView in a project. The columns were created using the Designer. I changed a few of the column types from
DataGridViewTextBoxColumn (original):
to ...
0
votes
1
answer
134
views
Filling Winforms datagrid using Postgres stored procedure
I am trying to get data from Postgres table with a help of stored procedure and fill a Winforms DataGrid with it.
This is the stored procedure:
CREATE OR REPLACE PROCEDURE public.get_list()
LANGUAGE ...
2
votes
1
answer
49
views
How to get a runtime list into a PropertyGrid?
Assembly A:
public class Data
{
public string Text {get; set;}
}
Inside Assembly B ( references A):
List<string> stringList = GetSomeStringsAtRunTime();
Data obj = new Data();
propertyGrid....
4
votes
0
answers
201
views
How does WinForms manage to display ⅓ for the Verdana font when it doesn't exist in that font? And why does it not work for Windows 11?
We had a bug with a □ appearing instead of ⅓ in one of our applications when it was run on Windows 11 rather than Windows 10. This was because we were using a font (Verdana) which did not contain the ⅓...
0
votes
2
answers
142
views
C# form.cs window has been edited in Visual Studio but the changes doesn't show when I run the project
I edited the contents of the DataGridView in an already existing project and I even double-checked the form's Designer.cs file and I'm positive that the new DataGridViewComboBoxColumns are there.
The ...
0
votes
0
answers
76
views
Invoke_Invoked event in Accessibility Insights for Windows
I have an issue with catching Invoke action.
I created a simple WinForms app, with a single text field and a single button. I want to catch the Invoke_Invoked event in the Accessibility Insight ...
1
vote
2
answers
178
views
How to make shapes, drawn on a form, resilient to changes in display's resolution / scale
An elegant solution for drawing polygons on a form was proposed by Jimi, as part of an answer to the question Why am I getting an extra line when drawing polygons? (see attached code).
I designed the ...
0
votes
1
answer
116
views
Can't properly align grid to bitmap in winform
I have a problem with winform Graphics.DrawImage and I hope someone will be able to give me some insight.
I have a bitmap of variable (and considerable) size that need to be displayed in a resizable ...
2
votes
1
answer
64
views
panel scroll slow paint thumb moving not properly
I have a panel with AutoSize property false and AutoScroll true. Inside this panel, there are some controls, various rows each one with a label and some numericupdown. The form is not double buffered, ...
5
votes
1
answer
174
views
Why am I getting an extra line when drawing polygons?
After some advice from kind people over here, I managed to have my code working. However, an extra line, from the origin of the form to the first polygon point, is also drawn.
I would like to learn ...
1
vote
1
answer
144
views
C# WinForms Panel cutting off way too much of controls inside it for no reason
I have a Panel inside a form and that panel is inside a tabpage of a tabcontrol. Everything is fine, also when I insert stuff on the left edge, but for whatever reason be it a bug in visual studio or ...
0
votes
0
answers
167
views
Unable to print barcode labels on my Dymo label writer 450 Twin Turbo using DYMO.Connect.SDK 1.4.4.21 using C#
I am developing a Winforms app using VS2022 in C# for .NET 4.8 to print accelerated reader labels for books. Some books do not have a barcode on the back so I added to may app the ability to take the ...
4
votes
2
answers
162
views
ToolTip.Popup event not firing with ToolTip.Show() in .NET Framework
I have an old WinForms application with a normal TreeView, where I need to show customized tooltips for individual nodes.
I am using a ToolTip component (OwnerDraw=true and IsBalloon=false), and I ...
1
vote
0
answers
141
views
Design time DataGridView column that cannot be removed?
I need a custom DataGridView that always has a checkbox column as first column.
I know how to achieve this at runtime. Any chance to display the column in the designer?
When added in the constructor ...
5
votes
1
answer
107
views
Tablelayoutpanel winforms cellpainting event draw a outside curve at first column
I am drawing a outside arc in first cell of each row in TableLayoutPanel. But I get different output.
I get it like this:
This is my code
this.tlp_tra_actual.CellPaint += new ...
4
votes
1
answer
106
views
Customized tooltip for TreeView nodes fails due to the Popup event not firing
We have an old (very old) WinForms application that depended on some 3rd party components that we are no longer allowed to use. One of those components was used to display tooltips on individual nodes ...
3
votes
3
answers
122
views
Dynamically create .NET buttons, with button pressed return its name, or other unique identifier
I am trying to dynamically add buttons to a list, and have $Button (or another variable) be set to whatever is clicked (No OK/Cancel button needed).
The below code creates the buttons, and resizes the ...