|
-
Jul 13th, 2001, 02:46 AM
#1
Thread Starter
Member
Right-Click on Rich Text Box
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.
-
Jul 13th, 2001, 03:13 AM
#2
PowerPoster
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
-
Jul 13th, 2001, 03:16 AM
#3
PowerPoster
Oh yeah, here is the different clipboard commands.
VB Code:
'Delete
RichtextBox1.SelText = ""
'Cut
Clipboard.SetText Richtextbox1.SelText
richtextbox1.seltext = ""
'Copy
Clipboard.SetText RichTextBox1.SelText
'Paste
RichTextBox1.SelText = Clipboard.GetText
Hope that helps.
-
Jul 13th, 2001, 04:21 AM
#4
Set the AutoVerbMenu property of the RichTextBox to True and you should get the default menu when right clicking the RichTextBox.
-
Jul 13th, 2001, 05:02 AM
#5
Fanatic Member
Check it...
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
Digital-X-Treme
Contact me on MSN Messenger: [email protected]
[VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
/ (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]
-
Jul 14th, 2001, 12:02 AM
#6
Thread Starter
Member
-
Jul 14th, 2001, 12:16 AM
#7
This is mad
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.
-
Jul 14th, 2001, 12:25 AM
#8
PowerPoster
Re: This is mad
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.
What is this supposed to do? It just printed a number to the debug window. Is it supposed to be a special number?
-
Jul 14th, 2001, 09:02 AM
#9
Fanatic Member
Fibonacci Numbers
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
Digital-X-Treme
Contact me on MSN Messenger: [email protected]
[VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
/ (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]
-
Jul 14th, 2001, 09:12 AM
#10
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.
-
Jul 14th, 2001, 09:21 AM
#11
Fanatic Member
Hmmm...
Medicus
It is a random number generated with an algo.
Nope, it prints the first 80 Fibonacci Numbers to the debug window. Trust me 
Maybe you are confused by the Round, and Rnd functions...?
Laterz
Digital-X-Treme
Contact me on MSN Messenger: [email protected]
[VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
/ (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]
-
Jul 14th, 2001, 03:12 PM
#12
Thread Starter
Member
***
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
-
Jul 14th, 2001, 04:57 PM
#13
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
|