Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LineScroll

Status
Not open for further replies.

Unrivaled1

IS-IT--Management
Feb 9, 2005
20
US
I have found numerous references to using the LineScroll(1); command in VC++ to scroll down one line in an Edit Box window. However, when I add it to my own MFC App, it gets a compile error of it being an Undeclared Identifier. So, it obviously doesn't even recognize the command. In the samples of code I've seen it used in, nothing special had to be #Included or #Defined, so I am a little confused.

Anyone have an idea?
 
Is it a CEdit control? LineScroll exists for either a CEdit or RichEdit control. You need to precede it by the identifier for the CEdit control.
 
Thanks for the reply. You're right in that it needed the identifier:

Cedit::LineScroll;

gives no compiler error, but also gives no line scroll. If I add:

Cedit::LineScroll(1);

or

Cedit::LineScroll();

It gives an error of: illegal call of non-static member function.
 
Any chance someone could post some sample code of forcing a Vscroll? I've found countless examples that don't work for me.
 
In your dialog decl you probably have something like
Code:
class CWhatever: public CDialog
{
...
   CEdit theEditBox;
};
You need to use
Code:
   theEditBox.LineScroll(1)
Just using CEdit::LineScroll(1) will send a WM_VSCROLL to the dialog. Since the dialog doesn't have any scroll bars (presumably it doesn't) nothing happens.
 
I guess I'm just not getting it..

The only place in my code that has class CWhatever: public CDialog is the CAboutDlg area.

I have a Vertical Scrollbar on my Edit Box window that was added via the Edit Box Properties under Styles. The ID for that Edit Box is IDC_EDIT2 and I've tried using IDC_EDIT2.LineScroll(1); but it errors out.

This doesn't seem like it should be all that hard, and I'm sure most anyone that uses Vscroll assigns this to it, so I can't understand while its so difficult to find an example of code that illustrates how it works.
 
Ok, I now have a control variable assigned to the Edit Box in question: m_EDIT2a

It seems like I should be able to:

m_EDIT2a.LineScroll(1);

or

m_EDIT2a.SetWindowText->LineScroll(1);


Maybe I'm way off base here..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top