Category "winforms"

Check if a record exists in the database

I am using these lines of code to check if the record exists or not. SqlCommand check_User_Name = new SqlCommand("SELECT * FROM Table WHERE ([user] = '" + txtBo

How to solve the error "Must use PackageReference"?

After adding WindowsRuntime to a WinForms-project, building the project fails with Error "Must use PackageReference". The build log is more precise: C:[...]\Vi

How can I obtain a vertical bar that fills, like a progress bar?

As the title says I'm trying to obtain a vertical a bar and fill it depending on values. I couldn't apply any answers I found. One answer suggested replacing Sy

Reset part of application settings

So, I have Form called Preferences with TabControl in it. This TabControl contains several TabPages(General, Advanced, Misc, ...) with few comboboxes, checkboxe

How to do non-cached file writes in C# winform app

I'm trying to determine worst case disk speed, so I wrote the following function. static public decimal MBytesPerSec(string volume) { string filename = vo

Does C# WinForms have a slider control?

Can someone guide me if C# WinForms has a slider control? I see WPF has it but it doesn't show up for me in WinForms what could be the problem?

c#: keep ref parameter from constructor in class

Basically i would like to be able to have a reference to a variable inside a instance of a class, but i'd like the reference to become a class variable so I don

Watermark TextBox in WinForms

Can anyone point me to a good implementation of a basic Windows Forms TextBox that will initially show watermark text that disappears when the cursor enters it?

How to do a background for a label will be without color?

I want to add a label to my form , and I want it without any color- I want just it's text to be visible, I don't find this option in the label's properties, can

How to prevent TextBox auto scrolls when append text?

I have a multi-line TextBox with a vertical scrollbar that logs data from real-time processing. Currently, whenever a new line is added by textBox.AppendText(),

Changing the default icon in a Windows Forms application

I need to change the icon in the application I am working on. But simply browsing for other icons from the project property tab -> Application -> Icon, it

Does .NET have icon collections?

Does .NET framework have a collection of icons for use in Windows Forms or WPF application somewhere? How does one use it? For example, how do I use it as an ap

How to delete the current cell in DataGridView?

How can I delete a current cell in a DataGridView. I am trying the code below, but it is deleting all cells except the current one. private void dgvPurchase_C

Using a BindingSource, how do I tell if I have changes pending?

I am using a BindingSource in a WinForms project that edits a simple table on a SQL server. I want the "Save" icon to light up when the user tabs off a field if

What is a StickyLabel, and why does it sit in a ContextMenuStrip.Contols collection?

I have a ContextMenuStrip which is tight to a ListView, and made of a combination of various ToolStripMenuItem and ToolStripSeparator. I would like this context

What does "Beta: Use Unicode UTF-8 for worldwide language support" actually do?

In some Windows 10 builds (insiders starting April 2018 and also "normal" 1903) there is a new option called "Beta: Use Unicode UTF-8 for worldwide language sup

What does "Beta: Use Unicode UTF-8 for worldwide language support" actually do?

In some Windows 10 builds (insiders starting April 2018 and also "normal" 1903) there is a new option called "Beta: Use Unicode UTF-8 for worldwide language sup