Posts by Eduardo Oliveira • 185 points
14 posts
-
0
votes1
answer86
viewsA: display multiple array by messagebox.Show on c# by clicking a button
If you don’t know the amount of elements that will enter your vectors, use List instead of this way (that doesn’t even compile). List<string> Nomes = new List<string>();…
-
1
votes2
answers120
viewsQ: What is the correct place to store the validation messages in a . NET project?
I’m creating a relatively simple class, but I’ve included some validations in its properties. public class Sala : EntidadeBase { #region Enums public enum StatusSala { Disponivel, Reservada,…
-
5
votes2
answers156
viewsQ: What is the correct way to do an Replace in a string-like variable?
I need to create a folder on the file server and realized that the variable that receives one of the information is coming with invalid characters ( / : * ? " < > |) for creating a folder on…
-
1
votes1
answer63
viewsA: Picking up content from a textbox from another frame
I would receive the name of the operator in the Pdvform constructor On the other form it would look like this private void BtnLogin_Click(object sender, EventArgs e) { PDVForm form = new…
-
1
votes1
answer66
viewsA: Pass data from a Datagridview in a Form to Combobox in another Form
The Code below should solve your problem frmb.cbbcidade.SelectedIndex = frmb.cbbcidade.FindString(dataGridView1.CurrentRow.Cells[1].Value.ToString()); NOTE: Make sure the combo is loaded first.…
-
0
votes1
answer65
viewsA: How to disable hotkeys in a textbox?
One of the ways to solve this is to select the control change the property option Shortcuts Enabled for False…
-
-1
votes1
answer65
viewsQ: How to disable hotkeys in a textbox?
I have a kind of control System.Windows.Forms.TextBox populated in my form and it had some validations, as allow me to type only numbers, however I realized that if I use the shortcut key to paste a…
-
4
votes1
answer113
viewsQ: How should I assign strings in C#?
As far as I know, System.String no. NET (I don’t know if on other platforms the string type is also like this) is immutable, ie if I do: string a = "texto"; a = "outro texto"; Behind the scenes, by…
-
-1
votes2
answers116
viewsA: How to use the same instance for multiple classes?
Dude, the problem is how you’re abstracting things... Looking specifically at this scenario, the Control class makes no sense to exist, because if you receive an instance of a Form Progressibar, you…
c#answered Eduardo Oliveira 185 -
1
votes1
answer259
viewsA: Close file used by visual basic . net
The Image.Fromfile Method keeps the file open. You should do it another way. You can and greatly improve your code, but to solve your problem, I did as below (based in that answer) and worked well:…
vb.netanswered Eduardo Oliveira 185 -
0
votes2
answers51
viewsA: How to make the background image different for each day?
In this case, the solution serves to change the background color, but the concept is the same for the image. switch($day) { case 'Monday': $bg_color = "red"; break; case 'Tuesday': $bg_color =…
-
0
votes4
answers14893
viewsA: Advantage and advantage between onClick and setOnClickListener
I had the same doubt and I deepened the subject and then of that answer I ended up convincing myself not to use onClick. Basically: the implementations of Android buttons indicate that the button…
-
-1
votes2
answers342
viewsA: What will be printed on the screen by this script?
Logically, the printed value is bar, but because this value was assigned to the variable $foo. Edit: Yes, testing in Fiddle, it is printed foo, but I did not understand why...
-
-4
votes1
answer67
viewsQ: Static Methods X Nonstatic Methods for Data Access Layer
I’m creating a layer in ADO.NET for data access and painted a question. It is good practice to have my methods of accessing data as Static instead of always having to instantiate the object and call…