473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Autoscroll woes

23s
I have 2 rich textboxes within an auto-scrolling panel object. The
textboxes aren't wider than the panel, so it never scrolls horizontally. But
the combined height of both textboxes is taller than that of the panel, so
the panel scrolls up and down in order to accomodate both of them. The user
can drag the Vscrollbar just fine and move about normally.

This setup is probably easier to illustrate than describe verbally:

---------------- < panel.top
|...................... < textbox1.top
|
|..................... < textbox1.height
|..................... < textbox2.top
|
|
---------------- < panel.height


....................... < textbox2.height

The panel needs to scroll primarily to accomodate textbox2, which is quite
tall.

The problem I'm experiencing is that when the user is typing into textbox2,
and the autoscroll of the panel is maintaining focus on the "carat" of the
textbox, something highly undesireable is happening at this point:

...................... < textbox1.top (currently out of viewable area)

...................... < textbox1.height (currently out of viewable
area)
..-.-.-.-.-.-.-.-.-. < textbox2.top, panel.top (autoscroll refuses to go
beyond this?)
|
|
|
|
|
|
---------------- < panel.height
^ < typing carat (currently out of viewable
area - bad!)
....................... < textbox2.height (currently out of viewable
area)

Autoscroll seems convinced that it should "never scroll down so much that
the .top of the currently focused textbox is outside the viewable area, even
if that means sacrificing the visibility of the typing carat". In my
application it's perfectly acceptable if the .top of the currently focused
textbox scrolls up out of viewable area - what's important to me is keeping
the carat within the viewable area, so the user can see what they're typing.
In this scenario, the user must now grab the bar with the mouse and manually
scroll down to reveal their carat. I want to do this for them,
programmatically.

The .top of textbox2 is 97, relative to the panel. I cannot manage to
scroll the panel to any point beyond 97 while retaining focus of textbox2 (I
can remove focus from textbox2 and scroll beyond 97, however, as soon as
textbox2 regains focus, autoscroll immediately jumps to 97 irrespective of
manually setting the autoscrollposition of the panel).

Manually setting the autoscrollposition of the panel seems unable to defeat
this issue. While the panel will report back that the new
autoscrollposition.Y is indeed 120, 100, or whatever I put there, what we
see on the screen does not change - it remains 97, and the carat remains
hidden from view below the lower boundry of the panel. I have not managed
to programatically scroll to any point beyond 97 in this scenario. I hope
this makes sense, any suggestions would be greaty appreciated.
Nov 21 '05 #1
0 1427

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alexander Brown | last post by:
I have a custom control inside a frame. The frame has autoscroll set to true. The control has its dock set to Fill, and anchose set to top and left. If i scroll around the control using the...
0
by: Yasin Gedik | last post by:
Hello, I have a problem with autoscroll property. I am designing a form for pocket pc 2003 in whidbey, and deploying it to emulator. I set the forms Autoscroll property true and put...
1
by: John | last post by:
I'm trying to use the DrawText() method to draw some very long string text on the Panel with AutoScroll enabled. However, for some unknown reasons, I could not trigger the ScrollBar to show up. ...
0
by: amit bharadwaj | last post by:
hi all am using a panel , now i want to programitally set the thumb of autoscroll. for tht i have override wndproc() and try to set it .. ant it does .. but after that autoscroll too modify...
5
by: Frank | last post by:
Hello, if autoscroll is true in a form. Is there a way to detect the scrollbars are active? Thanks Frank
0
by: Jeff | last post by:
I am making a custom control that displays images, allows zooming in and out, and can fit the image to the control. The way I am handling all of this is probably not best, but I was looking for a...
21
by: Sharon | last post by:
I have added an auto scroll feature to my DataGrid control like this: private void DoAutoScroll() { DataView dv = m_DataGrid.DataSource as DataView; DataGridCell cell = m_DataGrid.CurrentCell;...
0
by: eweaver | last post by:
Hello, I have a problem with getting an autoscrollbar to end up where I want it. Things to know about the prob: I have an imagebox inside of a Panel for (inheritance of) autoscroll capabilities....
1
by: =?Utf-8?B?R3VzIENodWNo?= | last post by:
I’m working on a GroupBox and need to set the AutoScroll property to true. My problem is I have no AutoScroll property listed in the property box. And even if I go in to the Designer.cs file I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.