• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

how to inherit my own class with all buttons and forms in vb.net

I have written my own custom class "BasicFunctions" in vb.net.
I must inherit this class with  both of all buttons and all forms in my project.
what is the ways ?

I write my own customize buttons and forms like following.

public class mybutton
inherits button
end class

public class myform
inherits form
end class

what are the ways available with above coding and without above coding ?
0
tamilsoft
Asked:
tamilsoft
3 Solutions
 
nepaluzCommented:
what exactly do you want to dowith the class?
1. Make it available in the designer?
2. Utilize the controlsin the class on the fly?
0
 
tamilsoftAuthor Commented:
I dont understand your comment.

My aim is I must inherit my own classs "BasicFunctions"   with   any buttons and  any window forms.
 how to inheirts with all controls ?
0
 
käµfm³d 👽Commented:
My aim is I must inherit my own classs "BasicFunctions"   with   any buttons and  any window forms.
Your goal is unclear. Inheriting buttons makes sense, but inheriting "any window forms" does not. What do you mean by inherit "any window forms"?

For inheriting buttons, it's quite simple:  add the pertinent buttons to the base form. When you inherit this base form, all the of the buttons you added to the base form should be accessible in the child form.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
tamilsoftAuthor Commented:
look my first question.

I have written my own class  "BasicFunctions.vb".  
I have created my own class named mybutton.vb.  it  inherits button. look my first question.
I have created my own class named myform.vb.  it inherits form. look my first question.  

BasicFunctions class should be inherited to myform.
BasicFunctions class should be inherited to mybutton.
how to achieve it ?

 
0
 
käµfm³d 👽Commented:
What kinds of things do the functions in BasicFunctions.vb do?
0
 
tamilsoftAuthor Commented:
InputValidityStatus()
NoOfAttemptsforInputs()

BasicFunctions.vb has like above functions.

I want to inherit  this class  any of my custom input controls like(MyTextBox, MyComboBox,etc)

public class mytextbox
inherits textbox
end class

public class MyComboBox
inherits ComboBox
end class

how to do  ?

0
 
AmbusyCommented:
you cannot have multiple inheritance in .NET. Read  this:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now