Closed Thread
Results 1 to 6 of 6

Thread: A couple of beginner questions

  1. #1
    Nille's Avatar
    Nille is offline Learning Programmer
    Join Date
    Apr 2007
    Location
    Sweden
    Posts
    41
    Rep Power
    0

    A couple of beginner questions

    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

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    VCKicks is offline Newbie
    Join Date
    Jan 2008
    Posts
    24
    Rep Power
    15
    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

  4. #3
    Nille's Avatar
    Nille is offline Learning Programmer
    Join Date
    Apr 2007
    Location
    Sweden
    Posts
    41
    Rep Power
    0
    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

  5. #4
    VCKicks is offline Newbie
    Join Date
    Jan 2008
    Posts
    24
    Rep Power
    15
    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

  6. #5
    Nille's Avatar
    Nille is offline Learning Programmer
    Join Date
    Apr 2007
    Location
    Sweden
    Posts
    41
    Rep Power
    0
    Thanks

  7. #6
    jireh is offline Newbie
    Join Date
    Jan 2008
    Posts
    18
    Rep Power
    15
    one more thing... please try ti install msdn in your pc, it will help a lot...your questions can be found there...

    regards.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. OpenGL beginner questions.
    By notes in forum C and C++
    Replies: 3
    Last Post: 11-02-2011, 12:47 PM
  2. A Couple Questions.
    By CommittedC0der in forum General Programming
    Replies: 2
    Last Post: 10-04-2010, 02:27 PM
  3. couple java questions
    By jamesw in forum Java Help
    Replies: 1
    Last Post: 03-28-2009, 05:50 PM
  4. Beginner at C#... questions
    By Programmr in forum C# Programming
    Replies: 4
    Last Post: 01-28-2009, 12:13 PM
  5. A couple of questions
    By CrazedDoc in forum Pascal and Delphi
    Replies: 2
    Last Post: 09-17-2008, 10:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts