473,805 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,
programmaticall y.

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 autoscrollposit ion of the panel).

Manually setting the autoscrollposit ion of the panel seems unable to defeat
this issue. While the panel will report back that the new
autoscrollposit ion.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 1444

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

Similar topics

0
1533
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 scrollbars and then click on the map nothing happens. If i autoscroll to exactly the same location and click the control then the scroll panel moves back to the top left corner (the intial location). Has anyone had similar problems? If so what did...
0
1450
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 something (for example a label) out side of visible part. When in design mode there is no problem, scrollbars automatically appears and works fine, but when i run (deploy) the
1
9368
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. Here is the simplicied section of drawing code: private void panel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { panel.AutoScroll = true;
0
1127
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 value of autoscrollpos ... for ex say i make auotscrollpos to 30 . then after the call is over , it becomes say 40 .
5
3292
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
1521
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 quick and easy way to at least get it working for now. I tried to keep this short, but I couldn't find a way to. The control has its Autoscroll property set to true. It contains a PictureBox at 0,0 with its SizeMode set to StretchImage. When...
21
9991
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; cell.RowNumber = dv.Count; m_DataGrid.CurrentCell = cell; } But this the last line of this code is putting the focus on the current
0
2897
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. The imagebox is named panel2 for my own conventions and the panel will be named panel1 Panel2 (the imagebox) is set to fit to the size of Panel1 (the Panel). All of this works great... I have broken up an extremely large image (width wise, not mem...
1
3393
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 can’t find the AutoScroll property. Do I need to set something up for this property? Any help would be appreciated. -- thank You
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10369
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.