-
I have a program that I'm trying to make it do something different but I don't know what the constants mean. Is there some table somewhere that lists what each one is?
Here is the code I'm using to show you what I'm talking about. It is called when you press a button to cause a text box to scroll up and down. I want it to scroll left and right. The constant set is : &HB6 .. How can I find what this means and where to find others?
Here is the code:
Function ScrollText&(TextBox As Control, vLines As Integer)
' The Windows Version Stuff...
#If Win32 Then
Dim Success As Long
Dim SavedWnd As Long
Dim R As Long
#Else
Dim Success As Integer
Dim SavedWnd As Integer
Dim R As Integer
#End If
Const EM_LINESCROLL = &HB6
' Get the window handle of the control that
' currently has the focus (eg. Command1). This
' is so that the control that had the focus when
' clicked gets the focus back. In this case on of the
' [U] of [D] buttons.
SavedWnd = Screen.ActiveControl.hwnd
Lines& = vLines
'Remove the comment (') if your TextBox is !ENABLED!
'# TextBox.SetFocus
' Scroll the lines, using the SendMessage.
Success = SendMessage(TextBox.hwnd, EM_LINESCROLL, 0, Lines&)
' Restore the focus to the original control which had
' the previous focus, which we previously recorded
' before.
R = PutFocus(SavedWnd)
' Return the number of lines actually scrolled.
ScrollText& = Success
End Function
-
EM_LINESCROLL is part of the selection and display messages for edit controls.
name is self descripting, it scrolls an edit control. What are these constants used for? They are api constants, used in api calls, to learn more about them I would recommend a vb book on api programming, one to look at I have is. Dan Appleman's VB 5.0 Programmers Guide to WIN32 API.
If you need some more, just keep posting I'll try to help out as I can.
-
Well is there an api call that will cause a horizontal scroll?
Jimmy
-
sendmessage works fine for what you are trying to do, would like me to list some of the other flags for ya?
like
EM_CHARFROMPOS Determines the character at a specified location in an edit control (not applicable in NT 3.51)
EM_GETFIRSTVISIBLELINE Determines the first line that is displayed in an edit control
......
[Edited by billrogers on 07-26-2000 at 02:36 PM]
-
The reason I need a horizontal scroll on the text box is that I have a ruler that will be attached to the top in the form of prolly another text box.
This way it will always be there, even when you load the file directory into the RTBox. But in order for the ruler to work it will have to scroll with the textbox.
If you could give me some way of doing this it would be most appreciated.
Jimmy