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
-
3
votes2
answers154
viewsFind out if particular control is a button
I have the following code that serves to change the color of the buttons that are in a panel: private void mudaCorBotao(Button bt) { foreach(Control b in Panel_esq.Controls) { if (/*[O que devo…
-
3
votes3
answers96
viewsCapture Textbox that called the event
I want to implement the wind GotFocus in a TextBox, so that when, he gets the focus, he sets the property Text as string.empty. However, I have 6 TextBox that will run this event. How do I identify…
-
3
votes1
answer142
viewsHow to place a Readonly column?
I’m trying to leave only one column of GridView as ReadOnly, I’m doing like this: if (id_crm == 0) { textBox2.Text = Convert.ToString(cod_crm()); DataTable dat_itens = new DataTable();…
-
3
votes1
answer874
viewsHow to use Curl with C#, windows Forms application
I’m trying to integrate my desktop application with an online tool (Scrumwise), but they use Curl, I’m not able to consume the Rest. curl https://api.scrumwise.com/service/api/v1/getData -k -u…
-
3
votes1
answer40
viewsSize of the form other than programmed
I created a form, with size 300;300, in it a button with the following code: MessageBox.Show(this.Size.ToString()); The Forms are getting too big for my screen, so that running can be readable. Why…
-
3
votes2
answers1320
viewsHow to hide a password in C#
I want to hide my password. What I want to happen is that while I type " * " is shown instead of characters, the problem is that it only happens when I click on the "Log in". Yes, I know this…
-
3
votes3
answers1491
viewsHow to replace the number of letters of a word with a character?
I’m doing a hangman’s game, let’s suppose I type the name "john" into a box of text, then I press a button and I want the "text 2" box to have "_ _ _", so I want the same number of underscore that…
-
3
votes1
answer391
viewsValidate data from an object with Dataannotations C# Winforms
Good afternoon, I have the following Entity class marked by Data Annotations: public class Cargo { [Key] [Display(Name ="Código")] public int Codigo { get; set; } [Required(AllowEmptyStrings =false,…
-
3
votes3
answers944
viewsAdd Text In textbox at a certain position C#
Hello, I am developing a dental software which one of the functions is to select a tooth on a button and add the name of this tooth in a textbox. Until then no problem, but the point is that this…
-
3
votes2
answers5175
viewsCopy a List to another List without dependencies
How do I copy data from one list to another in a way that is independent of each other? I have a list<> of a class I created where the data inserted in it, appear in a listbox, and I wanted to…
-
3
votes2
answers227
viewsChanging opacity of one form through another
I need to change the opacity of the main form every time the user clicks on the close button. When he clicks on this button the opacity is in this.Opacity = .75; and opens a new form asking if he…
-
3
votes1
answer4168
viewsHow to create a variable accessible in all Forms?
In my application you will have a login system. I want to create a variable to store the user id that is logged in, and that it can be accessed in all other forms. I need this because in my…
-
3
votes2
answers1003
viewsHow to display total rows of a table in a label
I don’t know how to pull the total lines of a table, code: public string Eventos { get; set; } SqlCommand comando = new SqlCommand("SELECT count(*) FROM Active", conn); SqlDataReader leitor =…
-
3
votes2
answers284
viewsHow to compare two string by marking the differences?
Let’s say I have the strings: Oi, meu nome é ítalo and Olá, meu nome é ítalo How to generate a result +- like this: Hi, my name is Italo Hello, my name is Italo The system must somehow mark the part…
-
3
votes4
answers449
viewsWhen the textbox is null, the button will be off
When to write in the textbox, the button will turn on, but when you have nothing on textbox will turn off. I was able to make the button method turn on but could not do the turn off if the textbox…
-
3
votes2
answers402
viewsSending information between PC (Windows Form, C#) and Android
I started to elaborate a project scheme, and as an idea I had to have several Androids devices sending data to a computer (I plan to do using Windows Form - C#, and maybe Xamarin for Mobile part). I…
-
3
votes2
answers271
viewsProblem running tasks with two buttons in the same form in c#
I’m new to c, so forgive me for making a rookie mistake. I need to put two buttons on the same form,one to call a form, and another to perform a function I’m trying like this: private void…
-
3
votes2
answers269
viewsSelect in windows form c#
Imagining I have 3 checkbox: 2.9.1 2.9.2 2.9.3 I wanted, that I click on the 2.9.3, selects me all that are behind. It’s the kind of a select all, but only select me from a given number upwards that…
-
3
votes1
answer590
viewsHow to apply 2 mascara to the same textbox windows form c#
I’m with 2 checkbox natural person and legal person, and only one textbox. I want to select on checkbox individual, I want to apply the mask to CPF, or when selecting the legal person he applies the…
-
3
votes1
answer811
viewsHow to display 2 BD tables inside a Datagridview in the application?
I have an application developed C# using the project Windows Forms that displays the People Database Table in a list in the field DataGridView. However I need to show in DataGridView also the table…
-
3
votes0
answers111
viewsThe Form gets stuck/Locked when I click the datetimepicker
I’m developing an application and I’ve done 90%, but I have a problem with the datetimepicker control. Normally its format is long, but I had to change to 'team' and enabled the ShowUpDown as true.…
-
3
votes2
answers1405
viewsAdd a checkbox column to the datagridview
How to add a Checkbox column in Datagridview ? I need to do this for the user to select the Datagridview line with the Checkbox and then click the Save button. private void…
-
3
votes1
answer123
viewsManage Datatable with lots of information
I have here a "small" problem with a DataTable. From an SQL query I am getting a huge amount of records (> 1,000,000), and although the consultation is relatively quick, the loading of the…
-
3
votes2
answers351
viewsSum values from a column in the database via date filter
I need to sum all the values of a column containing in each row a specific date, that is, in the database, the values are saved with the date typed in the textBox in the act of registration, and I…
-
3
votes1
answer83
viewsCode works with a messagebox but no no?
Good afternoon, I’m doing a little school work to learn how to control radio Buttons with a switch in winforms public Form1() { InitializeComponent(); Form1.CheckForIllegalCrossThreadCalls = false;…
-
3
votes1
answer5597
viewsERROR The index was outside the matrix limits (System.Indexoutofrangeexception)
//Esse código tem o objetivo de substituir uma letra por um código string usuario = Environment.UserName; string palavra = usuario.ToLower(); int tamanho_array = palavra.Length; var array = new…
-
3
votes2
answers86
viewsError saving BD change in C#
I have a certain error when making changes to some data registered in the database, picture below the error also follows the code used: private void btnSalvar_Click(object sender, EventArgs e) {…
-
3
votes1
answer141
viewsParent form superimposing child form C#
I’m developing a Windows Forms application in Visual Studio and I’m having a hard time. I put the parent form to Ismdicontainer and instead of adding Toolbox, I made a form only with buttons, it…
-
3
votes2
answers88
viewsAssign once control event to event method
I’m making a sequence of screens in the form, I have a main screen that loads other screens, the main screen is the Form1, and the subtleties will be the ones I will add on the main screen through…
-
2
votes3
answers10204
viewsHow to put a value that is saved in the database in a combobox?
I am using C# Windows Forms with . NET 3.5. I’ve inserted all Federation states into the property items of my combobox. When I search for a record saved from my comic book, the combobox does not…
-
2
votes4
answers4412
viewsHow to set the data of a Datagrid to a Textbox in C#
I am trying to set the data of the selected Datagrid line, which comes from B.D., to show in each Textbox. The data of each column of the selected row goes to a Textbox. How do I? Which method to…
-
2
votes1
answer987
views -
2
votes3
answers4012
viewsConfirmation of closing the form
I’m trying to create a confirmation for when the user tries to close a form either with a button, or by the button x, or Alt+F4, or right-click at the top and then click close, etc... I tried to use…
-
2
votes2
answers878
viewsHow to update Chart automatically every 60 seconds?
I have a project where I need to update a form every 60 seconds, and in the form there is a function to call Chart (graphic) and when I run the program the form perfectly initializes the graph but…
-
2
votes2
answers2118
viewsHow do I set a Radiobutton to default?
I have several radiobutton’s. How do I leave one marked as default? private void radioButton2_CheckedChanged(object sender, EventArgs e) { comboBox4.Visible = false; comboBox5.Visible = false;…
-
2
votes1
answer1551
viewsMove image inside a picturebox with the mouse without using the scrollbar
Please, does anyone know how I can move an image inside a pictureBox without having to click on scrollbar? What I want is to move the image, just by clicking the mouse on it so as to drag it inside…
-
2
votes1
answer71
viewsHow to make a global event
I develop a system in which, a user can send a message to another, (which is saved in the database, to have a conversation history), but I would like that while the user is using other functions of…
-
2
votes1
answer376
views -
2
votes1
answer271
viewsJDK 1.8 Genexus X Ev. 2
I wonder if the Genexus X Ev.2 or higher already allows compiling programs generated in Java with JDK 1.8. I have to do something different?
-
2
votes1
answer56
viewsrecover text from onmouseover statusbar
It is possible to recover text from status bar? on Windows.Form on VB6 could. I wonder if in C# it would be possible
-
2
votes1
answer69
viewsMultiple threads can interfere with timerControl
I am developing a program that contains more than 10 threads running ... has emerged the need to have two timers, one to block and the other to release a process, so I am using Winforms timerControl…
-
2
votes1
answer321
viewsControlling to prevent window from opening again in Mdiform
How do I check if a window has been opened? If it has been opened, bring it forward, otherwise open a new window. That is, I need to control the windows, checking them so that only one is open.…
-
2
votes1
answer506
viewsWrite Listview in SQL Database using Entity Framework and C#
I am developing a sales desktop application using C# and Entity Framework and I am having doubts about recording the items entered in ListView in the SQL database. How to save inserted items to…
-
2
votes1
answer109
viewsImage in C# Windows Forms
I’m doing a new project using C# windows Forms, and I needed to open an image and rotate it only horizontally. I looked for some examples on the Internet, but I couldn’t find one that was clear.…
-
2
votes1
answer557
viewsHow do I insert any file extension into an SQL database?
I always worked attaching only images in my BDD tables, I remember that converted to MemoryStream and then to Byte and inserted... But I need to insert any kind of file extension in my database.…
-
2
votes3
answers1047
viewsDo not allow typing space in maskedTextBox
In the windowsforms what is the simplest way to avoid typing spaces into a control maskedTextBox ?
-
2
votes1
answer343
viewsMagnifying glass for the keyboard cursor
I would like to create a magnifying glass to enlarge the region around where the keyboard cursor is positioned and also the focus on a form. I wonder if anyone has any suggestions on the subject. I…
-
2
votes1
answer803
viewsClick event. Display message in current form and open new form
I need to make the event click a button located on a form, open another modal form. While the other form is loaded, I need to display a message to the user in a Statuslabel of a Statusstrip. (an msg…
-
2
votes1
answer1412
viewsHow to instantiate an object of this class in C#
I’m reading Caelum’s booklet about C# and object orientation, so I put it in Account.Cs the following code: namespace Banco { class Conta { public int numero; public string nome; public double…
-
2
votes0
answers434
viewsError 501 when connecting with FTP
I have a C# (Windows Forms) application that accesses the company’s FTP to download some files and/or upload. Only, on two specific clients, the application cannot access FTP. It gives the following…