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?
--
Daisy The Cow
Now playing: Justin Timberlake ft 50 Cent - Rock Your Body In Da Club 2 3919
Daisy,
This design is flawed. If you want your control to know where the
scrollbar is, then the form should pass the scrollbar to the control in some
manner so that it can do what it needs to do with it. Either that, or the
control itself should be responsible for displaying the scrollbars, so that
it would know where they are.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com
"Daisy" <da***@nospam.oops> wrote in message
news:be**********@linux01.dannytuppeny.com... 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?
-- Daisy The Cow Now playing: Justin Timberlake ft 50 Cent - Rock Your Body In Da Club
> This design is flawed. If you want your control to know where the scrollbar is, then the form should pass the scrollbar to the control in
some manner so that it can do what it needs to do with it. Either that, or the control itself should be responsible for displaying the scrollbars, so
that it would know where they are.
I thought so!
I'll try attaching scrollbars inside my control. It's DockStyle is set to
Fill, I assume I can just dock scrollbars to the right/bottom from inside my
control?
--
Daisy The Cow
Now playing: Nothing This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gawelek |
last post by:
I would like to "cheat" VScrollBar in DataGrid. That means I want to link
for example
DataTable with 50 rows to DataGrid. But I want, that VScrollBar looks as if
DataTable contains
for example...
|
by: Durand |
last post by:
Hi all,
I'm trying to create a vScrollBar with a dynamic value. When I change the
maximum value inside a method, it works inside a method, but when I leave
this method the maximum value returns...
|
by: Ron Vecchi |
last post by:
I have a custyom control that has a property which wraps a collection. When
I add controls to the collection the OnPaint method of these newly added
controls never get fired.
But if I take the...
|
by: Hans [DiaGraphIT] |
last post by:
Hi!
In a windowsapplication i have a datagrid where I dont want the vertical
scrollbar to be visible. I can't find HorizontalScrollBar and
VerticalScrollBar properties anywhere.
I've tried...
|
by: bleedledeep |
last post by:
I have a DataGrid that ends up with a VScrollBar due to the number of
rows, and the behavior I want is for the bottom-most row of the
DataGrid to be shown, i.e., I want the VScrollBar all the way...
|
by: Tim |
last post by:
Dear All,
I have spend a number of hours attempting to find some answers about
how to remove the 3D BorderStyle within a combobox and have come to
the conclusion that the simplest method is to...
|
by: Peter Row |
last post by:
Hi,
I've started work on my own control some parts of which use standard
controls, others I need to draw on my controls surface to get the display
output I require, however....
I seem to be...
|
by: sean |
last post by:
I'm trying to create "rubber-band" rectangles by overriding the
OnPaint method to place rectangles on top of all graphic controls, but
when I call Me.Invalidate() (when the user moves the mouse),...
|
by: Longkhi |
last post by:
Hi everybody.
I have quite a problem with the vscrollbar component. The control I'm using has a built-in scrollbar, but I have 5 of those controls, and I would like to bind the external...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |