What event fires when tabbing to a hidden TextBox in VB.Net

  • Thread starter Thread starter Bill Fallon
  • Start date Start date
B

Bill Fallon

I have a Windows.Forms.Panel object that contains a column of TextBox
objects. When I tab to a text box that is below the visible area of the
Panel, the panel automatically scrolls vertically to make the TextBox
visible. What I need to know is what event gets fired when this scrolling
occurs? The Panel.Scroll event does not fire. I need to know this because
I have an adjacent Panel object on the left that contains a column of Label
objects and I need to keep these two panels synchronized so the labels are
always aligned with their corresponding text boxes.

Bill
 
I have a Windows.Forms.Panel object that contains a column of TextBox
objects. When I tab to a text box that is below the visible area of the
Panel, the panel automatically scrolls vertically to make the TextBox
visible. What I need to know is what event gets fired when this scrolling
occurs? The Panel.Scroll event does not fire. I need to know this because
I have an adjacent Panel object on the left that contains a column of Label
objects and I need to keep these two panels synchronized so the labels are
always aligned with their corresponding text boxes.

Bill


Bill,

In the context you describe no public event is raised/exposed for
handling. You may be able to handle the windows messaging event
directly by overriding WndProc() and handling the appropriate message
but I think you should examine and rethink your current approach
before attempting to go this route. My suggestion requires a lot of
work for something that might be solved more effectively in a
different layout or using different controls (tablelayout,
flowlayoutpanels, splitters, etc).

Without knowing anything about your requirements or why you have
implemented your layout in this manner, one suggestion I will make is
that you might want consider nesting the panel the labels are in into
the panel containing the text boxes. This is assuming of course that
there is at least one valid reason why they absolutely must be in a
seperate panel in the first place.

Good luck,
-- Geoff
 
Thank you for the suggestions. I found a solution to my problem which is to
use the Timer control Tick event to synchornize the panels.

Bill
 
Back
Top