- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
10 Posted Topics
Hey. As the topic states i want to use a streamwriter to write the listbox from form1, but the streamwriter is in form2. How do i get the data from form1 to form2? I have the code to write everything out etc, all I need is help to get the …
Do you want it so that if you press enter in your textbox it will click a button for you? If so you can use the following: [CODE]private void txtBox_keyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) //13 = enter { button1.PerformClick(); } }[/CODE] If this is not what …
In the solution explorer double click Program.cs (or right click and "View Code") There you will find: Application.Run(new Form1()); now change it to: Application.Run(new Form4());
It's a bit off-topic but could you please explain what the "@" is for in: string filename = @"C:\Temp\arrayfile.txt"; I believe I've done similar things without the @ and it works as it should but I've also seen many people using it pretty often, what exactly does it do? Thanks.
I think it's because the Form_Load event happens before the form itself is shown, therefore there is nothing to hide. I'm not sure but that's my guess, I don't have a solution for you yet though. I'm sure someone here will come up with something soon.
Hey. I would like to save a txt file from the listbox into a folder that the user chooses. I've got the writing to work, but so far it only saves the file to the debug folder (since I haven't specified another folder) This is what I have so far: …
If both textboxes have 4 - 20 characters the button is enabled. [CODE]private void textbox_keyUp(object sender, KeyEventArgs e) //add event to both textboxes { if (txtUser.Text.Length >= 4 && txtUser.Text.Length < 20) { if (txtPass.Text.Length >= 4 && txtPass.Text.Length < 20) { btnLogin.Enabled = true; } else { btnLogin.Enabled = …
Not completely sure what you're after but if you want to check if it's between 4 and 20 you could use: [CODE] if (txtUser.Text.Length >= 4 && txtUser.Text.Length < 20) { } [/CODE]
Hey. I'm making a Hangman and I have this code to retrieve a random word from a txt file: [CODE] private void ord() { Random random = new Random(); StreamReader read = new StreamReader("sweord.txt"); ArrayList lines = new ArrayList(); string line; while ((line = read.ReadLine()) != null) lines.Add(line); read.Close(); int …
Hey. I'm pretty new to C# and programming overall. I'm trying to make a Hangman game. Let's say the user want to make a guess at the letter "t". Then he should just have to press "t" on his keyboard and the form should recognize it. I currently can't even …
The End.
ereruh