D
Daisy
I've got a custom control that works fine, it's DockStyle is set to Fill for
the panel it's in.
I've just added a VScrollBar docked Right in the panel. It appears, and
works fine, however in the OnPaint method of my custom control, I need to
know where the scrollbar is, so I can paint the relevant part of my control.
Since the ScrollBar exists in my MainForm, and the customcontrol is a class
of it's own, I can't figure out how to get at it. I was looking at the
Container property on each control, trying to get back to the MainForm,
which I could then get at it from, but apart from not working, that also
only seems to work if you know the index for the control in it's container,
and not if you know the name.
How should I achieve this?
the panel it's in.
I've just added a VScrollBar docked Right in the panel. It appears, and
works fine, however in the OnPaint method of my custom control, I need to
know where the scrollbar is, so I can paint the relevant part of my control.
Since the ScrollBar exists in my MainForm, and the customcontrol is a class
of it's own, I can't figure out how to get at it. I was looking at the
Container property on each control, trying to get back to the MainForm,
which I could then get at it from, but apart from not working, that also
only seems to work if you know the index for the control in it's container,
and not if you know the name.
How should I achieve this?