|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
a a
|
Apr 5, 2006 - 10:40 PM
|
How do you programmatically set the scroll position of a datagrid? I tried using CExtScrollWnd::ScrollPos32Set but it didn’t work.
Code:
SiwModifyStyle(__ESIS_STV_NONE | __ESIS_STH_PIXEL, __ESIS_ST_MASK); ScrollPos32Set(SB_HORZ, 100);
|
|
Technical Support
|
Apr 6, 2006 - 11:21 AM
|
We cannot confirm what you said about ScrollPos32Set() . If you click a cell in a partially visible column, the grid will get scrolled horizontally to make this column fully visible. This is done by the EnsureVisibleColumn() method which is based on OnSwDoScrollBy() . The latter uses ScrollPos32Set() . We can help you check your grid initialization code and figure out what’s wrong.
|
|
a a
|
Apr 9, 2006 - 8:29 PM
|
Ok. Seems like ScrollPos32Set() wasn’t working because I was using it just after the Create, maybe. It’s working elsewhere.
Code: bool Create(CWnd *parent) { Create(parent); // ... ScrollPos32Set(SB_VERT, 10); // doesn’t work here. }
void ScrollDown() // Called by a menu command { int pos = ScrollPos32Get(SB_VERT); ScrollPos32Set(SB_VERT, pos + 10); // here it works. }
|
|