|
-
Jun 5th, 2004, 11:42 AM
#1
Thread Starter
Frenzied Member
Undo error - well it's not working!
I have the following code,but when the user clicks on the undo menu item - nothing happens.
Is there anything obvious I should or shouldn't be doing?
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_USER = &H400
Private Const EM_UNDO = &HC7
Private Sub mnuUndo_Click()
UndoTextBox rtb1
End Sub
Private Sub UndoTextBox(Txtbx As RichTextBox)
Dim X As Long
X = SendMessage(Txtbx.hwnd, EM_UNDO, 0, 0)
End Sub
I am fairly new to API's so is this correct?
-
Jun 5th, 2004, 11:56 AM
#2
Your code is correct and works for me.
Do you set any properties of the RTB control? I never changed anything.
It may depend on which OS, RTB version etc...
-
Jun 5th, 2004, 12:06 PM
#3
Thread Starter
Frenzied Member
Do you set any properties of the RTB control?
None that I can see, it's used in it's default setting.
It may depend on which OS, RTB version etc...
Win XPPro
RTB Version - MS Rich Textbox Control 6.0 (sp1)
RICHTX32.OCX
-
Jun 5th, 2004, 12:38 PM
#4
Originally posted by aikidokid
None that I can see, it's used in it's default setting.
Win XPPro
RTB Version - MS Rich Textbox Control 6.0 (sp1)
RICHTX32.OCX
I use the same OS and control that you do and it doesn't work for me either. I've tried previously without success to implement the undo and it hasn't worked. Neither have supposedly working projects that I've downloaded from the web. I don't know what version of the ocx Bruce uses but I suspect it stopped working with the switch to VB6.
-
Jun 5th, 2004, 12:42 PM
#5
Thread Starter
Frenzied Member
Thanks Martin,
Have you found any workaround for this?
How do yoiu impliment the undo function in your apps then?
-
Jun 5th, 2004, 12:47 PM
#6
I haven't and since it was just an experiment I haven't actually implemented undo in any app. I think however that psc has some examples using an array that lets you implement undo functionality.
-
Jun 5th, 2004, 12:50 PM
#7
Thread Starter
Frenzied Member
OK thanks. I will take a look over there.
-
Jun 5th, 2004, 01:08 PM
#8
I don't know what version of the ocx Bruce uses
XP Pro
Visual Studio 6
RTB Version - MS Rich Textbox Control 6.0 (sp4)
Richtx32.ocx - ver 6.088.4
I also have Visual Studio 2003 installed.
-
Jun 5th, 2004, 01:10 PM
#9
Would you mind attaching that ocx?
-
Jun 5th, 2004, 01:18 PM
#10
Thread Starter
Frenzied Member
This is the version I have installed: 6.1.97.82
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
|