Newsgroup: it.comp.lang.visual-basic
Titolo: Rich Text Box Right Click

Hi, all. I'd like to be able to make a right click onto a rich text box 
to move the cursor - same as a left click - then pop up a context menu. 
I've the context menu no problem. I've tried using the mouse_event API 
within the Mouse_Down procedure, but it behaves strangely. Anyone know 
how to go about it? Thanks.
Ray Bradley
Tech Strategy Group, Inc.
San Francisco, CA
bra...@techstrategy.nospam.com

Hi Ray -- I had same problem and the answer I got seemed to work. Try to
handle it with menus:
From: 
vo...@mail.dec.com
 (Steven Vore)
Newsgroups: comp.lang.basic.visual.database
Subject: Re: RTF control -- Right clicking?
Date: Fri, 06 Jun 1997 13:50:08 GMT
Should be...  Here's a RTcontrol with a popup (that doesn't do anything, but
it pops up)
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0";
"RICHTX32.OCX"
Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   4755
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5445
   LinkTopic       =   "Form1"
   ScaleHeight     =   4755
   ScaleWidth      =   5445
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1
      Caption         =   "Command1"
      Height          =   375
      Left            =   3000
      TabIndex        =   3
      Top             =   3960
      Width           =   1335
   End
   Begin VB.TextBox Text1
      Height          =   375
      Left            =   960
      TabIndex        =   2
      Text            =   "Text1"
      Top             =   3960
      Width           =   1575
   End
   Begin RichTextLib.RichTextBox RichTextBox1
      Height          =   3615
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   4815
      _ExtentX        =   8493
      _ExtentY        =   6376
      _Version        =   327680
      Enabled         =   -1  'True
      TextRTF         =   $"popup.frx":0000
   End
   Begin VB.Label Label1
      Caption         =   "Label1"
      Height          =   255
      Left            =   360
      TabIndex        =   1
      Top             =   4080
      Width           =   615
   End
   Begin VB.Menu popFormat
      Caption         =   "Format"
      Visible         =   0   'False
      Begin VB.Menu popBold
         Caption         =   "Bold"
      End
      Begin VB.Menu popItalic
         Caption         =   "Italic"
      End
      Begin VB.Menu popUnder
         Caption         =   "Underline"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub RichTextBox1_MouseDown(Button As Integer, Shift As
Integer, x As Single, y As Single)
If Button = 2 Then
 Form1.PopupMenu popFormat
End If
End Sub
Ray Bradley ha scritto nel messaggio ...


Try this
Public Sub Disable95PopupMenu(c As Control)
    Call SendMessage(c, 1399, 1, 0)
End Sub
Public Sub Enable95PopupMenu(c As Control)
    Call SendMessage(c.hWnd, 1399, 0, 0)
End Sub
--
############################################
# Niels Andersen
# 
http://users.cybercity.dk/~dko2897/
# 
nand...@vip.cybercity.NOSPAM.dk
# to respond directly, remove NOSPAM
############################################