Ok guys once again i need your expertise i have recently started some C# programming and i have a couple of problems i dont quite know how to solve
(i wish to warn you for the noobishness of these questions)
1. I have made a program and i want to have to textboxes in it and thats not that mutch of a problem but i want the user to write in one of the boxes but i dont know how to make the program input wat is written in the box?
2. In this program of mine i want to be able to have a background image and thats quite easy but how should i do to resize it to fit in the window?
3. Is it posible to set a background image and then make a button that changes the background to another image?
And if so please tell me how
Thanks in advance![]()
1. [name of textbox].Text will return the user input as a string (for example string input = textBox1.Text
2. Check the Form properties, one of them is BackgroundImage SizeMode or something to that sort, I can't recall exactly, but by default it's set to Tile, change it to Stretch
3. Have the button do something like this.BackgroundImage = Image.FromFile("path");
Visual C# Kicks - Everything C#.NET programming related
Thank you so mutch for the help VCKicks it helped alot
If its not to mutch trouble i was wondering if you can do nr 3 without a button so if you just press a certain key or the mouse insted of a button it will change the image?
and one again thanks: D
Check out the picturebox's events (in the properties tab, lightning icon). There you'll find several Mouse events (including Click). For a key press you'll need a KeyUp or KeyPress event, however those can be a little trickier, but try them out to see which one works best
Visual C# Kicks - Everything C#.NET programming related
Thanks![]()
one more thing... please try ti install msdn in your pc, it will help a lot...your questions can be found there...
regards.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks