Questions tagged as 'winforms'

1
answer

Shape size 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 large for my screen, so running can be readable. Why is the size of the form changed when...
asked by 24.05.2017 / 20:38
1
answer

How to make the keydown function work with the program in the background?

Code: if (e.KeyCode == Keys.F7) { A1 = !A1; } How to make this code work without the program being in the foreground?     
asked by 18.02.2017 / 17:15
2
answers

C # Windows Forms Generic Object

I have a Desktop application in C # and need to load a dropdown with an "All" option and the rest coming from a database table. To load the dropdownlist I did something like this: cmbOpcoes.Items.Add(new { Id = 0, Name = "Todos" });...
asked by 12.05.2016 / 00:13
1
answer

How to put a ReadOnly column?

I'm trying to leave only one column of GridView as ReadOnly , I'm doing so: if (id_crm == 0) { textBox2.Text = Convert.ToString(cod_crm()); DataTable dat_itens = new DataTable();...
asked by 04.09.2016 / 18:06
3
answers

Printing text file on thermal printer with PrintDocument?

I'm developing a system in WinForms with C # and now I need to generate a sales receipt coupon and print to a thermal printer. I've been reading about PrintDocument but I can not find examples of how to generate coupon using this print API. I do...
asked by 25.09.2016 / 23:05
1
answer

Validate 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, ErrorMessage = "A descrição...
asked by 29.10.2016 / 16:58
1
answer

How to get the path of the subfolder that was "SELECTED" in the listbox by the user and save the file inside

The program I'm creating should take the following steps: First, the user creates a subfolder to save the projects that have been calculated by the program, according to the image and code below. When you create a subfolder, for example...
asked by 16.06.2016 / 01:54
2
answers

How can I save TXT file in C: \ directory using C #?

I'm trying to make a small program for scrolling data and I want it to save a .txt file that stores the scrolls so it can be read later. The program is practically whole ready, all the features working, but when I try to select the directory whe...
asked by 30.10.2015 / 13:17
1
answer

How to capture text that another console program writes on the screen

My Windows Forms program runs another console program. This second writes messages on the screen during execution. I want to know if it has to prevent the execution of the other program from opening the console, and instead the printf of the oth...
asked by 10.07.2015 / 19:47
2
answers

Object reference not set to an instance of an object

I know the question is a little subjective, but maybe someone has already gone through it and can help me. I have an application developed in C # / Windows Forms / ADO.NET with firebird database. The "Object reference not set to an instanc...
asked by 16.03.2016 / 15:24