-
Sep 10th, 2003, 09:09 AM
#1
Thread Starter
Hyperactive Member
Scroll Bar Position
Is there a way to get the scroll bar position (vertical & horizontal) of any VB control that uses it (i.e. TEXT CONTROL) ?
-
Sep 10th, 2003, 02:43 PM
#2
I assume your talking about getting the position of a multi-line
textbox scrollbar, for example?
To accomplish that you would probably need to use some APIs.
Why not just determine the line the cursor is on instead (or column position)?
This won't solve all the problem, but it is simpler than using the APIs.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Sep 10th, 2003, 02:57 PM
#3
Thread Starter
Hyperactive Member
Actually, I need to use this functionality to a dbGRID control instead of a text box control. My problem is when I refresh the grid which is bounded to an ADODC1, the whole grid shifts down and it confuses the USERS.
If I could only get hold of where the scroll bar is prior to the refresh and bring it back to that position aft5erwards so that the grid relative to the screen stays the same.
-
Sep 10th, 2003, 03:12 PM
#4
Try the ScrollBar api functions.
GetScrollPos and SetScrollPos
GetScrollInfo and SetScrollInfo
-
Sep 10th, 2003, 03:25 PM
#5
Since you are using the dbgrid, use the .TopRow property to
determine the visible row that is at the top position of the grid.
Store that in a var and after the refresh set the .TopRow equal to
the value in the var. Easier.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Sep 11th, 2003, 03:51 PM
#6
Thread Starter
Hyperactive Member
GetScrollPos and SetScrollPos
GetScrollInfo and SetScrollInfo
I used both GetScrollPos & GetScrollInfo, doesn't seem to work for a third party VB control. I'm using Sheridan DataWidgets 3.12. I get a dll error of 1447 (the window does not have scroll bars).
If I use any MS VB controls with scroll bars, there's no problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|