Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Multiquestion: 'if' Statements And Hotkeys.


  • Please log in to reply
3 replies to this topic

#1 Wolfy87

Wolfy87

  • Members
  • 414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:England
  • Local time:09:41 PM

Posted 09 September 2008 - 05:16 PM

Ok, im still working on my RPG and im improving it with code i learn every day BUT...i would like to know how to use the if statements which would be used for making log in forms etc (i can and have done this in VB). Also is it possible to assign buttons to keys ie the left arrow key will make image1 go and image2 show to the left of it. i can make it by click to move but i would like to use wasd or the arrow keys.
Many thanks, Wolfy.

BC AdBot (Login to Remove)

 


#2 Wolfy87

Wolfy87
  • Topic Starter

  • Members
  • 414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:England
  • Local time:09:41 PM

Posted 10 September 2008 - 10:28 AM

This is what i have so far with 'if'...

private void button12_Click(object sender, EventArgs e)
{
#if radioButton1.Checked = true
textBox3.Text = "Hello";
#endif

but i still dont know how to assign keys :/
Please help...

#3 Wolfy87

Wolfy87
  • Topic Starter

  • Members
  • 414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:England
  • Local time:09:41 PM

Posted 11 September 2008 - 10:21 AM

Ok i got the hot keys now i use the &_ thing and i cant use this for navigation unless i can get the help with if statements... what am i doing wrong...io can do it in VB but not here

#4 Wolfy87

Wolfy87
  • Topic Starter

  • Members
  • 414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:England
  • Local time:09:41 PM

Posted 13 September 2008 - 06:28 AM

Dont worry i worked it out now i have been using this in my tester form...
private void button8_Click(object sender, EventArgs e)
{
//Makes the progress bar decrease slowly and stop when too low.
if (progressBar1.Value < 1)
progressBar1.Value = (progressBar1.Value = 0);
if (progressBar1.Value > 0)
progressBar1.Value = (progressBar1.Value - 1);
}

Thank god for you tube :thumbsup:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users