scrollable viewport control creation

B

Brian Henry

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
 
Y

yEaH rIgHt

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

Ken Tucker [MVP]

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

Brian Henry

it needs to be clickable like a chart in MS project too... so just as a
bitmap im not sure of yet...
 
Y

Ying-Shen Yu[MSFT]

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

Jeff Bennett

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
(e-mail address removed)

* 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

=================== ===================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top