generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How do I add an event to a Button (C#)?

Previous Thread :: Next Thread 
mew903 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
26 Dec 2011 03:00 PM
This is in C#, btw

So far I am stumped.

okay, so here is my button:

Button thisButton = new Button()

Controls.Add(thisButton)

but I am unsure of how to create an event to the button so when I click it, something happens(MessageBox.Show, etc)

Help?
Report Abuse
LocalChum is not online. LocalChum
Joined: 04 Mar 2011
Total Posts: 6906
26 Dec 2011 03:03 PM
btn.Click += new EventHandler(delegate(object sender, EventArgs e) { });
Report Abuse
mew903 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
26 Dec 2011 03:04 PM
Thanks, I'm doing to go test it now :D
Report Abuse
mew903 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
26 Dec 2011 03:06 PM
It works :D

+1 respect for LocalChum/Walter%d%d%d
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image