Category "winforms"

Databind Object to Winforms DatagridView with ComboBox

Currently I'm trying to databind object properties to a datagridview. The thing is that the datagridview should have a combobox column, where the user has to ch

How to exclusively set the value of a DataGridViewCheckBoxCell?

I have a List<Car> objects that have a bool property named Marked. I want to check / uncheck the Cell corresponding to this property, in a way that only o

Copy selected text of a RichTextBox to the Clipboard with a Mouse Click

I have a RichTextBox(RTB) that obtains text from two sources a txt file and data from a SQLite DB. The RTB has ReadOnly property set to False. I am trying to NO

Is there a way to exclude document files from the installation folder for vb.net project?

I have created a windows form application using vb.net 2019, and everything seems fine until I found out that an .xml document which contains confidential files

How make pages in Winforms?

I would like to make pages for UserControl but I don't know how I can do this. How can I implement this as in the picture in WinForms? I would like to display a

Handle MouseMove, MouseDown, MouseUp Events in a ListView to drag a borderless Form

I'm using MouseMove, MouseUp, MouseDown events to move a borderless form (as found here as an example). It works great, but for a ListView, it only works if I c

how can i use a function from MyForm1.h in MyForm.h

i have a funcion 'button1_click' in the header 'MyForm1.h'. I want to use this function in another header 'MyForm.h'. How can i do this? i already included 'MyF

How to prevent a popup Form from exceeding screen area?

I am building a two column custom context menu layout using Forms. I named the class of the form of the custom context menu as ContextMenu. I created a flag fun

How do I restore focus to previously focused control of the TabPage when switching between tabs

I have a TabControl and I'm adding Tabpages to it programmatically. Each TabPage loads a UserControl in it, and each user control contains a few controls. For e

Return ID of newly inserted row on a PostgreSQL database using C# and Npgsql?

I'm building a WinForms project in C# using a PostgreSQL database and the Npgsql framework. For inserting a record, I need to return the ID of the new record.

Synchronize the Scroll position of two Controls with different content

I use this simple code to set the position of two Scrollbars of different RichTextBox Controls, at same time. The trouble comes when the text of a RichTextBox i

How to move a ListViewItem part of a Group in place of another ListViewItem using the same ListView?

Below I'm trying to move item4 in place of item5, the action I expected was for item 4 to be on top of item5 and item5 under item4: Below I'm trying to move it

How to call a callback function on a GUI event? Delegates?

I'm very new to C# and I'm wondering if using delegates is the right way here: I created a UserControl in Visual Studio Windows Forms Designer. In a TableLayout

Build Created in VS19 Stopped all Crystal Reports of Build created in VS15

We have run in to a problem. We are creating a software using VS19 and we are using Crystal Report Version 13.0.26.3348 with this. When we created the build and

FileStream.ReadAsync blocks UI if useAsync is true, but doesn't block UI if it's false

I read about the useAsync parameter in this FileStream constructor: FileStream(String, FileMode, FileAccess, FileShare, Int32, Boolean) I tried to use the Fil

CS8804: Cannot specify /main if there is a compilation unit with top-level statements [closed]

searching "C# compilation unit" does not reveal any useful results around the internet

How to export a registry key in C#

I am trying to write a C# code, which will block exe files from running. I found a question about the same topic: example question. In the question suggested me

How do you make a new FlatButtonAppearance object?

I'm running into a frustratingly stupid problem with the FlatButtonAppearance object, which apparently has a constructor that I can't find any information about

How do I create a textBox autoCompleteSource from dataset table?

In my Winform I have a TextBox. I set it to "AutoComplete", and I want to know what to write in my code (c#), to set it's "AutoCompleteSource" to some column's

Windows forms scalling

I'm trying to avoid wrong form showing when "Scale and layout" in windows screen settings is different than 100%. I've folloved this LINK, and it works but only