chuawenching Posted July 27, 2003 Posted July 27, 2003 Hi there, By default when you double click a button in c#, it is something like this: private void button1_Click(object sender, System.EventArgs e) but i want to change the parameter to private sub Button1_Click(Index as Integer) as i need to do some validations.. (that code is in vb6) Any help? Regards, Chua Wen Ching :p Quote
*Experts* mutant Posted July 27, 2003 *Experts* Posted July 27, 2003 You cant change the arguments that event handlers accept. Quote
chuawenching Posted July 27, 2003 Author Posted July 27, 2003 Hmm.. then what should i do! in vb6, you can do this: button1_Click() 'empty parameter button1_Click(index as integer) ' with some parameters i set myself then i c#, i only can focus on button1_click(object sender, eventargs e) Sad.. really nothing i can do! At least can show me some guidelines, i want to build all my previous vb6 programs into c#! Regards, Chua Wen Ching :p Quote
*Experts* mutant Posted July 27, 2003 *Experts* Posted July 27, 2003 What are you trying to do? Maybe there is a better way. Quote
chuawenching Posted July 27, 2003 Author Posted July 27, 2003 Hi there. this is my codes in vb6: private Action as integer private sub button1_Click(index as integer) Action = Index End Sub private sub picture1_mousedown(button as integer, shift as integer, x as single, y as single) if Action = 0 then // draw a square here end if if Action = 1 then // draw a circle end if if Action = 2 then // draw a fillbox end if end sub Yeah.. something like that... Any help! How will you code that in c#? Thanks. Regards, Chua Wen Ching :p Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.