Hi,
I want to know: is there any way I can keep a right-click menu in a Rich Text Box? Thanks a lot,
Mel.
Printable View
Hi,
I want to know: is there any way I can keep a right-click menu in a Rich Text Box? Thanks a lot,
Mel.
You probably have to make one yourself, then add some code to call it in the mousedown event. Here is some code for a menu called mnuEdit.
VB Code:
Private Sub RichTextBox1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 2 Then PopupMenu mnuEdit End Sub
Oh yeah, here is the different clipboard commands.
Hope that helps.VB Code:
'Delete RichtextBox1.SelText = "" 'Cut Clipboard.SetText Richtextbox1.SelText richtextbox1.seltext = "" 'Copy Clipboard.SetText RichTextBox1.SelText 'Paste RichTextBox1.SelText = Clipboard.GetText
Set the AutoVerbMenu property of the RichTextBox to True and you should get the default menu when right clicking the RichTextBox.
I posted an example of a menu sub classing example a few weeks back which enabled yout to use your own popupmenu in place of default ones. This is useful, as when using the method detailed by MidgetsBro, you sometimes get flickering from the menus, as the default pops up, then your own.
The attachment is attached to this thread: http://forums.vb-world.net/showthrea...=WMCONTEXTMENU
Hope this helps in some way :)
Laterz
Thanks a lot guys!!!
VB Code:
For x = 1 To 80 Debug.Print Round(((((1 + Sqr(5)) / 2) ^ x) - ((-1 * ((1 + Sqr(5)) / 2)) ^ -x)) / Sqr(5), 0) Next x
How do people come up with those things? Geez..I would have to sit back, take a long break, and maybe reconsider programming!
Wow! What a mind cruncher.
What is this supposed to do? It just printed a number to the debug window. Is it supposed to be a special number?Quote:
Originally posted by Medicus
VB Code:
For x = 1 To 80 Debug.Print Round(((((1 + Sqr(5)) / 2) ^ x) - ((-1 * ((1 + Sqr(5)) / 2)) ^ -x)) / Sqr(5), 0) Next x
How do people come up with those things? Geez..I would have to sit back, take a long break, and maybe reconsider programming!
Wow! What a mind cruncher.
It prints the first 80 Fibonacci numbers using the formula for the Nth Fibonacci number. Check out the Maths forum for more info on Fibonacci numbers :)
Laterz
For sure it is a special number.
It is a random number generated with an algo.
That bib long Round(((((1 + Sqr(5)) / 2) ^ x) - ((-1 * ((1 + Sqr(5)) / 2)) ^ -x)) / Sqr(5), 0)
thing = a number generated by the system in a way.
Not bad but...
There is a way to make a REAL random number but I don't have the time right now.
Nope, it prints the first 80 Fibonacci Numbers to the debug window. Trust me :)Quote:
Medicus
It is a random number generated with an algo.
Maybe you are confused by the Round, and Rnd functions...?
Laterz
I asked how to get a right-click memu in an RTF box
and it turned into a discussion about Fibonacci numbers!
That's weird :D
Sorry! :D Threads go way off track a lot around here. :) At least you got your question answered, didn't u? Sometimes I post somthing, and the question never gets answered. I don't mind, it's fun to get into new conversations.