Re: Loss of precision when drawing gridlines and blocks on top.....



Thanks for the responses Michael and Bob - I'm very grateful.

What I've ended up doing is having a property which allows you to
define the width of a column (represents one hour - I'm building a
timeline control for multiple elements down the left). I then
calculate the amount of pixels as a float which represent a second in
time (columnwidth / 3600) and then multiply that up by the amount of
time I'm trying to display. I do the same to plot the gridlines which
define the columns, and round using a generic function which
theoretically should give me the same result for two different
calculations with the same parameters. You're right though, to try to
split up 50-100 pixels into 24 equal segments for display is
ridiculous - hence my new approach of allowing the user to define the
column width.

This leads me onto my next problem. I need to implement scrolling in
my control, but I'm struggling to find resource to help me with it.
There are a couple of alternatives:

1. Create a composite control and have scrollbars.
2. Inherit from Scrollable control and let the framework draw the
scroll bars (i've not been able to get this to work in the slightest!!
I'm trying to follow this but it doesn't display scrollbars when I
paint outside of the bounds of the controls ClientRect:
http://www.dotnet247.com/247reference/msgs/53/267790.aspx - This is my
preference.
3. Draw my own scrollbars - this isn't my preference.

Could anyone give me a good place to start. I'm drawing my control
bigger than the client area - I just need to display scrollbars to
allow the user to scroll to non-visible areas.

Thanks guys.
.



Relevant Pages

  • Re: TreeView Trouble
    ... I would do all this by subclassing listview only. ... I am making a useful new control. ... column will have extra text related to the treeview item. ... My custom control has its own scrollbars and I want to use those for the ...
    (microsoft.public.win32.programmer.ui)
  • Re: ScrollableControl Problems
    ... the VScrollBar control is managed and provides events and other ways to control and interact with the scroll bar so ... Forcing scrollbars won't help you unless you're prepared to code all of the functionality yourself. ... Derive from Control and perform all your drawing operations as necessary in an OnPaint method override (this will be your ...
    (microsoft.public.dotnet.general)
  • Re: UserControl Issue
    ... If you have to have control over the size of scrolling changes, ... still use the AutoScroll feature - but you have to resort to some API calls, ... Panel control appropriately - the scrollbars will take care of themselves. ... > Is it possible to do this using AutoScroll? ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: How to find the Thumb size?
    ... >reference to control the scrollbars of other controls, like listbox, ... problem is that listbox, MLE and other controls do their own scrollbar ... A SWT application it is a Java application that invokes OS APIs through ...
    (comp.os.os2.programmer.misc)
  • Re: Question on Buffered Graphics
    ... method to set styles at run-time instead of in the constructor. ... but when the image exceeded the size of the form and the scrollbars popped up, the menu would scroll off-form while scrolling through the image. ... I cannot change the panel styles or over-ride OnPaintBackground for the Panel control. ...
    (microsoft.public.dotnet.framework.drawing)