Most voted "winforms" questions
Winforms is the informal term given to Windows Forms, is a graphical interface application included as part of Microsoft . NET Framework. Winforms provides native visual access to Microsoft Windows window interface using existing Windows API in managed code.
Learn more…1,192 questions
Sort by count of
-
4
votes2
answers121
viewsSoftware Release by Customers
The system I develop has several clients who use it. But I have a problem which is this: if I release a new version of the system, I raise it to the ftp, all customers using it have access to this…
-
4
votes2
answers445
viewsUpdate Text linked to a Databinding
I have the following property linked to a label, where the value of this property appears in the text field. Like this: this.labelPedidosHoje.DataBindings.Add("Text", pedidosIntegrados,…
-
4
votes2
answers523
viewsHow to create progress bar for uploading file via Google Drive API
I am sending file to Google Drive by their API. The request.Upload(); is lingering with no return. How do I make progress? It can be with a for even without a graphical user interface. Shipping…
-
4
votes1
answer8783
viewsHow to set Grid View column width?
I would like to know how to define the width of the DataGridView manually. My first column has to have a fixed value and the other columns must "fill" the grid so that they are the same size.…
-
4
votes2
answers758
viewsCheck for installed components
In my project I have a built-in browser so that the user can access a particular site he needs. The browser works, only it has as requirements the C++ 2012 library and Flash. Is there any way to…
-
4
votes1
answer3589
viewsHow to assemble a page for printing within the application code?
I need to assemble a printing page inside my code, that is I will not print an existing document, nor the application screen, I want to assemble the code execution with the elements I want. I have…
-
4
votes0
answers177
viewsHow to monitor the progress of a VB.NET INSERT query?
I’m storing files in a database SQL server using a varbinary(max) field. I wonder if it is possible to detect the progress of the file upload (in which case it would be a INSERT in the table) using…
-
4
votes2
answers2151
viewsHow to shift the focus from one Textbox to the next?
I’m trying to shift the focus of the field after the user writes 2 digits. Validation is ok, but I haven’t found a method to change focus. NOTE: It is a dynamic method used for various fields, so I…
-
4
votes2
answers995
views -
4
votes3
answers3895
viewsDouble click on a Datagridview line transports the data to a form
Good morning to all. Next staff, I have a (query) form that contains the Datagrideview. And the registration form in another form. I would like to understand, how can I double click on a line of…
-
4
votes1
answer425
viewsColoring words from Richtextbox
My goal is to color all the words that are inside double quotes, and the quotation marks as well! For example: "This text needs to be colored".
-
4
votes1
answer1608
viewsProgressbar and Backgroundworker in C#
I’m creating an app with Firebird 2.5 in which I need her to read a file .sql with instructions to popular the database if it has not yet been done this process, because it is a little long and not…
-
4
votes1
answer415
viewsStatic public variables in C#
How can I organize my code? When programming there are variables that I am leaving in the same code at the top as: namespace myData.MySql { public partial class teste { public static string…
-
4
votes1
answer386
viewsRecover Volume Name of Netmapped Disk Drive
I’m using DriveInfo.GetDrivers() to take the names of the disk drives present on the machine and list them on a TreeView. I made the code below that works, however it does not appear the names of…
-
4
votes4
answers13213
viewsTextbox accept numbers and commas
I need that one textBox accept only numbers and commas. To accept numbers I’m doing so: private void textbox11_num(object sender, KeyPressEventArgs e) { if (!char.IsDigit(e.KeyChar)) { e.Handled =…
-
4
votes1
answer1524
viewsWhat is the Expect100continue property for in System.Net.Servicepointmanager?
I am working on a system that manages customer licenses. There is a feature in my system to return the customer’s product key , making a query on Web Service. And simple you inform the CNPJ it…
-
4
votes1
answer747
viewsSilent installation of Postgres and creation of the installer base
How I can embed the Postgresql database in my Winforms system installer? I can even put it as a prerequisite to install before system binaries, however I wanted to do a silent installation. I would…
-
4
votes1
answer53
viewsComboboxes that share the same Datasource, swap the selection together
I am doing a production order project and I have 7 combobox picking the values from the same table (which are the raw materials). I’m using this code on load form to load the combobox:…
-
4
votes4
answers447
viewsC# Textbox to stop receiving after comma
I need a textbox to stop receiving values after the comma, once it reaches 2 houses. To simplify, think that the text has limit after the comma, but none before it. Example: Type the number 2.99.…
-
4
votes4
answers1102
viewsHow to show data from 2 tables in a grid?
I am developing an application using Windows Forms and I wanted to be able to show the data of 2 tables in a gGrid, by SQL command I can do this SELECT SU.SUBCATEGORIAID, SU.NOME, SU.CATEGORIAID,…
-
4
votes1
answer421
viewsUser Control C#
I have the following user control that is being used in a Form: public partial class CampoTelefone : UserControl { private void maskedTextBoxTelefone_Validating(object sender, CancelEventArgs e) {…
-
4
votes2
answers7812
viewsAccessing Components from Another Form
I have two Forms in my application. A Form for data from an engine that has the following fields: txtPotencia, txtTensao and txtCorrente. I would like to access the values filled in these TextBox…
-
4
votes1
answer60
viewsHow to create verification that will validate if Reportviewer is installed?
I need to create a check that will validate the installation of Report Viewer on the user’s machine. If not installed, I need to receive this information to make a treatment present a message to the…
-
4
votes1
answer442
viewsHow to simulate the event of typing the % (percentage) symbol when pressing Shift+5?
I was developing a calculator in C#, and started doing the activation part of the buttons through the keyboard. if (e.KeyCode == Keys.Add) { btnsum.PerformClick(); } Using the code above, I already…
-
4
votes1
answer1530
viewsHow to put a background image and make it responsive?
I’m learning C, so I’d like to know how to put a background image (background) and also remove the blue edges. I’m using Visual Studio. Ps: some videos I saw on Youtube were basically about going…
-
4
votes1
answer301
viewsHow to make an element disappear after used?
How to make an element disappear after used for example : When you click on a button it disappears and appears something like a Listbox? Ps1 : If the question is confused warn Ps2 : If you can tell…
-
4
votes3
answers11041
viewsPrinting text file on thermal printer with Printdocument?
I am developing a system in Winforms with C# and now I need to generate a sales receipt coupon and print on a thermal printer. I’ve been reading about Printdocument but can’t find examples of how to…
-
4
votes1
answer2601
viewsWhat is the difference between Show(), Showdialog() and Application.Run()?
I read something about modal but did not understand, someone could explain?
-
4
votes2
answers836
viewsWhat code should be used to focus a Textbox?
What code should be used to focus a Textbox? I am creating a system, where I need that when the client keystrokes ESC, the focus of the textbox is lost. How do I do?
-
4
votes1
answer799
viewsConsole in windows Forms application
I have a class where opens the console, shows some data and then closes, when running a second time (without closing the program), an exception occurs in Console.WriteLine("") If executed once,…
-
4
votes1
answer1448
viewsHow to toggle lines of a report with custom colors Crystal Reports and C# winforms?
In the report I’m doing, I’ve managed to alternate colors by doing the following: Access to the Menu: Crystal Reports - Report - Section Expert Select the section Details and click on the tab Color…
-
4
votes1
answer1477
viewsWhat exactly does the Application.Doevents() method do?
According to the help of Microsoft, the method Application.Doevents(): Processes all Windows messages that are currently in the message queue. But what does that mean? Why does he say messages? What…
-
4
votes2
answers701
viewsCombobox read only
I’m trying to get a combobox read only (as the option ReadOnly of textbox), tampering with the properties of the object, but I’m not succeeding. The combobox is in a common windows form. It will be…
-
4
votes1
answer1109
viewsHow to change the color of the progress bar?
I’d like to do two things on my progress bar. Change color from green to red. Remove the blocks and create a color. I’m using Visual Studio Community 2019 on Windows 10.…
-
4
votes1
answer394
viewsValidating USB Serial Port Name
People, I am doing the approval of a scale in c#, I can make the communication via code all right, however when making the connection, I need to specify the name of the port, I have other connected…
-
4
votes1
answer767
viewsAccess methods from another Form
I have a form called TelaInicio where I have a method CarregarGrid() I would like to access this method through my other form Cadastrar I’ve left the method CarregarGrid()as public but still do not…
-
4
votes1
answer98
viewsBug to popular a Data Gridview in Window Forms
To popular my grid the values are not aligned correctly, as the image below. This is my Load Form code: DatabaseRepository db = new DatabaseRepository(); var colunas = db.GetColumnsName(); var…
-
4
votes2
answers83
viewsForm closing without close()
Dear friends, I have a very simple form that is closing after clicking OK on Messagebox. I have already reviewed everything, compared it with other papers I have and I haven’t found the solution. If…
-
3
votes1
answer705
viewsHow do I make my Master Form know when a secondary form has been closed, without using Parent and Child?
I have my main form (image below), and in it a Split Container. I open a secondary form (which is currently displayed) on panel2 of SplitContainer, where the user selects an account to perform…
-
3
votes3
answers2054
viewsProtect the connection string in a . NET Winforms application?
I have an app .NET Windows Forms connecting to a server SQL Server directly, without the use of an intermediate layer as a Webservice or Webapi, through SqlConnection. This application is installed…
-
3
votes2
answers1600
viewsCompare the values of an entire column of Datagridview with a variable
I would like to compare the value of a string type variable with an entire column of Datagridview. There is a code that looks at the whole column, more or less like this textbox.Text =…
-
3
votes1
answer79
viewsHow to add "Buttons" to Tabbedpanel
I am involved in a personal project in which I intend to elaborate a calculator with some items that are inserted in "arrays". I opted for a class called "Calc.Cs" to build a method with a code…
-
3
votes2
answers428
viewsHow to remove the option selected in multiple Comboboxes?
I have several components of the type ComboBox with identical options. The user must select one of them(e.g. "Name"). How to do so when an option is selected, in any one ComboBox, she disappears…
-
3
votes1
answer737
viewsLoop asynchronous calls and process data at the end of all runs
I have a method of web service which receives the IP of a server as a parameter and returns a DataSet. Several servers must be consulted by this web service, Um List<string> contains the list…
-
3
votes2
answers239
views -
3
votes1
answer1867
viewsHow to associate datatable fields to Datagridview columns?
My problem is following, I make a query in the database that returns me a datatable with a wide variety of fields. The goal is to display this query in datagridview, however, displaying only some of…
-
3
votes1
answer1354
views -
3
votes2
answers8812
viewsHow to take the value of a Listbox from the selected index of another Listbox?
I’m trying to get the value of a ListBox from the selected index of another ListBox, but it doesn’t work. What I have so far: for (int i = 0; i < 10; i++) { Lst_ListBoxA.Add(2 * (3 * i) * 4);…
-
3
votes1
answer1774
viewsHow to group by 2 properties and sum the values
I have no idea how to do this consultation on LINQ. How can I from sales list. Separate the sales per hour, then group the products and add up the quantities sold? public class Venda { public int Id…
-
3
votes6
answers15655
viewsClear a datagridview in C#
I tried all this already and nothing has worked. Everyone is deleting the lines and column. What I need is to clear the content written on them. datagridview.datasource=null;…