473,379 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

I doubt that you can do this

I want to make my own picture box which is the VB picture box plus things
like scrollbars.

I'd like to inherit the VB picturebox but need to add additional controls to
my picturebox.

I don't imagine there is any way I can automatically have all the VB
picturebox properties be also my picturebox properties. Which is what
inheritance would give me.

Is there anything close?
Thanks
Cal
Nov 20 '05 #1
9 988
If you make a new class that inherits from the picture box class, why
wouldn't you have all the properties of a picture box?
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I want to make my own picture box which is the VB picture box plus things
like scrollbars.

I'd like to inherit the VB picturebox but need to add additional controls to my picturebox.

I don't imagine there is any way I can automatically have all the VB
picturebox properties be also my picturebox properties. Which is what
inheritance would give me.

Is there anything close?
Thanks
Cal

Nov 20 '05 #2
* " active" <ac****@REMOVEa-znet.com> scripsit:
I want to make my own picture box which is the VB picture box plus things
like scrollbars.

I'd like to inherit the VB picturebox but need to add additional controls to
my picturebox.

I don't imagine there is any way I can automatically have all the VB
picturebox properties be also my picturebox properties. Which is what
inheritance would give me.


The easiest way to do inherit from
'System.Windows.Forms.ScrollableControl' and extend it with the
functionality of a picturebox.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
If I inherit how can I add scrollbars?
Is there a way to do that?

Cal

"Scott M." <s-***@badspamsnet.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
If you make a new class that inherits from the picture box class, why
wouldn't you have all the properties of a picture box?
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I want to make my own picture box which is the VB picture box plus things like scrollbars.

I'd like to inherit the VB picturebox but need to add additional
controls to
my picturebox.

I don't imagine there is any way I can automatically have all the VB
picturebox properties be also my picturebox properties. Which is what
inheritance would give me.

Is there anything close?
Thanks
Cal


Nov 20 '05 #4
I already have the code to add and use the scrollbars.. Would there be a big
advantage to using ScrollableControl over using Control and Scrollbars (I
assume there is still a scrollbar control.)

Thank
Cal
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* " active" <ac****@REMOVEa-znet.com> scripsit:
I want to make my own picture box which is the VB picture box plus things like scrollbars.

I'd like to inherit the VB picturebox but need to add additional controls to my picturebox.

I don't imagine there is any way I can automatically have all the VB
picturebox properties be also my picturebox properties. Which is what
inheritance would give me.


The easiest way to do inherit from
'System.Windows.Forms.ScrollableControl' and extend it with the
functionality of a picturebox.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
* " active" <ac****@REMOVEa-znet.com> scripsit:
If I inherit how can I add scrollbars?
Is there a way to do that?


Not so easy, because 'PictureBox' doesn't inherit from
'ScrollableControl' and multiple inheritance is not supported by .NET.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
* " active" <ac****@REMOVEa-znet.com> scripsit:
I already have the code to add and use the scrollbars.. Would there be a big
advantage to using ScrollableControl over using Control and Scrollbars (I
assume there is still a scrollbar control.)


Where do you use the scrollbars? Did you add them to the picturebox?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
I have a usercontrol that contains a picturebox and two scrollbars

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* " active" <ac****@REMOVEa-znet.com> scripsit:
I already have the code to add and use the scrollbars.. Would there be a big advantage to using ScrollableControl over using Control and Scrollbars (I assume there is still a scrollbar control.)


Where do you use the scrollbars? Did you add them to the picturebox?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #8
* " active" <ac****@REMOVEa-znet.com> scripsit:
I have a usercontrol that contains a picturebox and two scrollbars


That will work too, but why not inherit from 'ScrollableControl' and
add a picturebox?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
Just pointing out, you can set the AutoScroll property of any control
container to True and it will automatically show scrollbars if any controls
are outside the visible boundaries of the container. Maybe you could use
that instead?

Andrew

" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I want to make my own picture box which is the VB picture box plus things
like scrollbars.

I'd like to inherit the VB picturebox but need to add additional controls to my picturebox.

I don't imagine there is any way I can automatically have all the VB
picturebox properties be also my picturebox properties. Which is what
inheritance would give me.

Is there anything close?
Thanks
Cal

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the...
138
by: ambika | last post by:
Hello, Am not very good with pointers in C,but I have a small doubt about the way these pointers work.. We all know that in an array say x,x is gonna point to the first element in that...
4
by: dam_fool_2003 | last post by:
I am just a beginner in tree data – struct. I have this little doubt. Left node ‘weights' lesser than the right one. I have seen, so far it is algorithm implementations. But why not vice-versa that...
20
by: maadhuu | last post by:
firstly, i am thankful to all those who answered the 1st set of doubts. And i am not yet enlightened to that extent , coz ' i keep getting doubts. is the following defined in the language ?? int...
3
by: SMG | last post by:
Hi All, It might be a silly doubt, but it is a doubt.... I am using form authentication for my website, now my web application is gonna be deployed on two web servers with Load Balancing...
77
by: muttaa | last post by:
Hello all, My doubt is going to be so primitive that i ask you all to forgive me beforehand.... Here's the code snippet: int main() { int x=5;
11
by: Bob Nelson | last post by:
I don't remember seeing the term ``doubt'' used much in c.l.c. back in the 90's. When did this word become nearly synonymous with ``question'' or ``query'' and does it have static duration?
122
by: ivan | last post by:
hi all, if I have: if(A && B || C) which operation gets executed first? If I remeber well should be &&, am I correct? thanks
5
by: Paulo | last post by:
Hi, I have a RadioButtonList and I need to do some verifications on a "OnChange" event on client... because on classic asp/html I just add a "onChange" event on <input type="radio" onChange="">,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.