Questions tagged as 'winforms'

1
answer

How to close the program by pressing the

How can I close the program by pressing ESC? Even if it has a MessageBox or something else stopping it? I tried this way but could not: private void Form_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escap...
asked by 28.05.2018 / 03:20
1
answer

Why does not this work on my user control?

I have a code that would like to put it in the user control of my windows forms, but it does not make changes to Form1, what's the reason? Code: private void button5_Click(object sender, EventArgs e) { Form1 f1 = new Form1(); var ta...
asked by 18.05.2017 / 00:37
1
answer

How to have more than one column being displayed in a ComboBox?

The question is the same as the title, I have a ComboBox called txtProfissional and I set the same thing like this: txtProfissional.DataSource = modelOff.profissionals.Where(p => p.idUnidade == oUsuario.unidade); txtProfission...
asked by 12.06.2017 / 20:27
2
answers

Use ProgressBar to copy folders and their contents

I have an application in C # WinForms that when clicking a button, should start copying various folders and their contents. Since this process is time-consuming, I'd like the user to know how the progress of the process goes through Progre...
asked by 23.03.2017 / 19:02
2
answers

Accepting null fields in a Texbox

When I click on "Save", the program does a check of Texbox with a negotiation that I did not to let pass numbers repeat, the problem is that it of error if any Textbox is blank. Here is the code I saved saving the information in an...
asked by 03.01.2017 / 19:08
2
answers

Save image to directory without SaveFileDialog

I'm developing an inventory control application and in this application there is a product registration screen: TheimagesoftheproductsarebeingsavedintheMySQLdatabase.Ireceivedsometipsanditwasnotrecommendedtosaveimagesinthedatabase,becausethe...
asked by 26.07.2016 / 16:15
1
answer

C # When you open form 2 wait 5 seconds and open form 3

I need to load form 2 and wait for 5 seconds to automatically open form 3 how do I do it? private void LetTheGameStart_Load(object sender, EventArgs e) { timer1.Start(); } This is the only code I have right now     
asked by 25.07.2016 / 16:43
1
answer

Scrollbar on Windows Forms screen

Is it possible to put scrollbar in winforms to increase the amount of window content? Not only in a datagrid , but on the whole screen to include anything like more buttons, text fields ... The goal is to unify three tabs in a single v...
asked by 16.05.2016 / 22:04
1
answer

Resize elements according to the size of the form

I have GroupBox within a Form that has the following pattern: Padrão de tela - Form: 1290;700 - GroupBox Principal: 1260;600 This Form is opened through MDI. I use a function to center this form according to the size o...
asked by 03.03.2016 / 16:48
1
answer

C # Windows Form - Questions about Session

I need to save an information by the time the user is logged in to my software, I searched and saw that for web pages made with ASP.NET there is the object SESSION , but for Windows Form? The information I need and the user name, I have...
asked by 21.07.2016 / 15:15