Questions tagged as 'winforms'

1
answer

Abstract Form Inheritance

I have a default Form, with a textbox , a search button, and a grid; as I intend to use it for several searches, I left an abstract search method () and at the same time the form as abstract ... When inheriting this form, implement in the...
asked by 24.04.2017 / 01:22
1
answer

Save data from a textbox in a class and display in a datagrid

I am making a program for simple registration, without using a database, only with an array. The program was already functional when I noticed that the most important part was wrong because I had not understood correctly. I just did not use the...
asked by 02.03.2017 / 12:58
1
answer

Problem in DialogResult having to press the button 3 times to open

I'm having a serious recurrence problem with DialogResult. ThisistheLoginscreen,thankstotheuseofDialogResult,thereisastrangeerror,youhavetopressLogartwice.ThefirstoneitpicksupthatDialogResultisOKbutforthere,itdoesnotreturnandtests,youhavetoc...
asked by 01.03.2017 / 16:19
1
answer

Find the index of dataRow

I'm traversing a DataTable with a foreach using a variable of type DataRow , however I'm having to retrieve the index of the DataRow I'm traversing. foreach(DataRow row in DataTable.Rows) { string descricao = Co...
asked by 23.02.2017 / 15:17
1
answer

argument out of range exception was unhandled

I'm a beginner in VB.NET and I'm creating a simple simulation game, have hunger, thirst etc, in progressbar hunger the maximum that arrives is 100. When you eat something restores 5, if I'm 98 and how it gives error. I would like to know i...
asked by 09.02.2017 / 20:37
3
answers

Using CellClick to load data from a record

I'm doing a C # application in Windows Forms from Visual Studio without using a database, I'm handling everything by one class (Person) and two other classes (PersonFisica and PersonJuridica) inherited from the base class. I'm trying to load...
asked by 06.03.2017 / 13:51
2
answers

Constructor method to calculate age

I am making a very simple client registration application I would like to know how to program a method that calculates and returns the age (in years) from the AnoNascimento attribute. I know how to do, for example, a "public static int Calculati...
asked by 03.03.2017 / 02:44
1
answer

Insert with datatime Postgresql and C #

I would like to ask a question, why does not the first date work?    Cmd.Parameters.AddWithValue ("@ dtUltAccess", "2017-01-01 01: 01: 01 + 09"); Error returning:    Error inserting user - Error: 42804: column "usu_dataacesso" is of   ...
asked by 17.03.2017 / 01:24
1
answer

Arduino + C # + RFID?

I can get the id of the tag with this code snippet and play in a Textbox , but, how would I get the information of which reader RFID it was read? serialPort1.Open(); string entrada = serialPort1.ReadLine(); serialPor...
asked by 18.03.2017 / 14:09
1
answer

How to create this expression in C #

At first, the program I did the calculation using the following expression: valorComDescontos = valorTotal - (valorTotal * percentual); Where valorTotal is a value assigned by the user (a variable), percentual is a fixed value...
asked by 15.02.2017 / 18:25