Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a 'form1' form (a class) with a Button1_click Sub on it

How do I make this sub NotInheritable ? ( I have another form (form2) , Inheriting form1 and I want to put in another code for Button1_click )

Development & Research Department @ Elven Soft
Posted

in The 2nd form, I want to write another code for Button1_sub

 

for example, if in form 1, Button1_sub does Msgbox("Form1,Button1") and I inherit form 1 ( in form 2 ) it will do the same

 

well , I want the button in form 2 to do msgbox("Form2,button1")

Development & Research Department @ Elven Soft
  • Administrators
Posted

In form2 you don't need the Handles Button1.Click on the following line

Protected Overrides Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

The event is already being handled by the base class' Handles statement. Remove the handles clause and things sould now work.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

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...