Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...