By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,939 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,939 IT Pros & Developers. It's quick & easy.

scrollable viewport control creation

P: n/a
Hello,

I want to make a control that has a scrollable Gantt type display (not
really one but will look similar to one) this is going to be custom drawn (i
already have the drawing procedure completed for the overriden onpaint
event) but the problem is this can be a very long scrollable viewport (part
that scrolls inside the control) while the control will be relatively
800x600 in size)... i tried to do this with a panel scrolling inside of a
user contrl but it turned out that the panel has a max size of 32,000 pixels
long, while my timeline bars may be much longer then that... how would you
handle something like this? thanks
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Draw only what would be seen. Since your control is always going to be 800 x
600, just paint that portion of your display. There is no reason to paint
the whole thing.
"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
Hello,

I want to make a control that has a scrollable Gantt type display (not
really one but will look similar to one) this is going to be custom drawn (i already have the drawing procedure completed for the overriden onpaint
event) but the problem is this can be a very long scrollable viewport (part that scrolls inside the control) while the control will be relatively
800x600 in size)... i tried to do this with a panel scrolling inside of a
user contrl but it turned out that the panel has a max size of 32,000 pixels long, while my timeline bars may be much longer then that... how would you
handle something like this? thanks

Nov 20 '05 #2

P: n/a
Hi,

I would place a picturebox in the panel with the sizemode set to
autosize. Set the autoscroll property of the panel to true. I would
draw my Gantt type display on a bitmap. Set the bitmap to be the
picturebox's image. The panel will handle the scrolling for you if the
image is bigger than the panel. Hope this helps.
Ken
-----------------

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:eo**************@tk2msftngp13.phx.gbl:
Hello,

I want to make a control that has a scrollable Gantt type display (not
really one but will look similar to one) this is going to be custom drawn
(i
already have the drawing procedure completed for the overriden onpaint
event) but the problem is this can be a very long scrollable viewport
(part
that scrolls inside the control) while the control will be relatively
800x600 in size)... i tried to do this with a panel scrolling inside of a

user contrl but it turned out that the panel has a max size of 32,000
pixels
long, while my timeline bars may be much longer then that... how would you

handle something like this? thanks


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004
Nov 20 '05 #3

P: n/a
it needs to be clickable like a chart in MS project too... so just as a
bitmap im not sure of yet...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

I would place a picturebox in the panel with the sizemode set to
autosize. Set the autoscroll property of the panel to true. I would
draw my Gantt type display on a bitmap. Set the bitmap to be the
picturebox's image. The panel will handle the scrolling for you if the
image is bigger than the panel. Hope this helps.
Ken
-----------------

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:eo**************@tk2msftngp13.phx.gbl:
Hello,

I want to make a control that has a scrollable Gantt type display (not
really one but will look similar to one) this is going to be custom drawn (i
already have the drawing procedure completed for the overriden onpaint
event) but the problem is this can be a very long scrollable viewport
(part
that scrolls inside the control) while the control will be relatively
800x600 in size)... i tried to do this with a panel scrolling inside of a
user contrl but it turned out that the panel has a max size of 32,000
pixels
long, while my timeline bars may be much longer then that... how would you
handle something like this? thanks


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004

Nov 20 '05 #4

P: n/a
Hi Brian,

If you use ownerdraw, you need handle the mouse click by yourself.
You may save the rectangle of each gantt bars, then handle the mouse down
event of the picturebox , check if the cursor position is inside a certain
bar then execute the right methods for this bar click.

Is it helpful to your problem?

Have a nice day!

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.

Nov 20 '05 #5

P: n/a
> I want to make a control that has a scrollable
Gantt type display (not really one but will look
similar to one) this is going to be custom drawn
. . .
the problem is this can be a very long
scrollable viewport (part that scrolls inside the control)
while the control will be relatively 800x600 in size)...
. ..
it needs to be clickable like a chart in MS project too...
so just as a bitmap im not sure of yet...

Would you consider dumping the Picturebox for
another control that gives you a scrollable zoomable
image where you can draw your chart and have each part
of the chart be clickable? This sounds like what
you want. If yes, then take a look at our MetaDraw control
at www.Bennet-Tec.Com. MetaDraw will also allow you to
quickly save and reload the chart, Print, copy to clipboard,
dynamically modify the chart ( hide some lines, change the colors, etc).

Check it out at www.Bennet-Tec.Com

Drop a note back here and let us know if this
works for you, but please also cc me by e-mail
so I know to look her for any reply or follow up
questions.

-----
* * * * Please include a copy of this message with your reply

Jeff Bennett
Je**@Bennet-Tec.Com

* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================
"Brian Henry" <br**********@newsgroups.nospam> wrote in message news:<ev**************@TK2MSFTNGP12.phx.gbl>... it needs to be clickable like a chart in MS project too... so just as a
bitmap im not sure of yet...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

I would place a picturebox in the panel with the sizemode set to
autosize. Set the autoscroll property of the panel to true. I would
draw my Gantt type display on a bitmap. Set the bitmap to be the
picturebox's image. The panel will handle the scrolling for you if the
image is bigger than the panel. Hope this helps.
Ken
-----------------

"Brian Henry" <br**********@newsgroups.nospam> wrote in message
news:eo**************@tk2msftngp13.phx.gbl:
Hello,

I want to make a control that has a scrollable Gantt type display (not
really one but will look similar to one) this is going to be custom drawn (i
already have the drawing procedure completed for the overriden onpaint
event) but the problem is this can be a very long scrollable viewport
(part
that scrolls inside the control) while the control will be relatively
800x600 in size)... i tried to do this with a panel scrolling inside of a
user contrl but it turned out that the panel has a max size of 32,000
pixels
long, while my timeline bars may be much longer then that... how would you
handle something like this? thanks


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.