473,320 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Textbox Controls, PopUpMenu, and Almost-Solution

By default, right-clicking the TextBox control launches a standard "edit"
pop-up menu.
Microsoft provides a work-around for the case where you want to launch a
different pop-up menu;

http://support.microsoft.com/default...microsoft.com:
80/support/kb/articles/Q224/3/02.ASP&NoWebContent=1

The work-aound works, but has a near-fatal (in my opinion) flaw, which
Microsoft warns you about; if you end execution of the program without
having de-activated the workaround (via code in an Unload event) the VB IDE
itself crashes.

This means;

- When executing your program (in the IDE) you can't use the "Stop/End"
button or VB will crash

and worse

- If you encounter a bug in your program, many times (at least for me)
you're going to get crashed out of VB because the "End" button would crash
you directly, and if you go into "Debug" mode, unless the problem is easy to
fix you're ultimately going to do an End (and crash)

Does anyone know of a way to 'work-around this work-around" ?

Thanks a lot,

Bob Kochem
Jul 17 '05 #1
3 5499

"Bob Kochem" <r.******@worldnet.att.net> wrote in message
news:8C*************@nwrdny01.gnilink.net...
By default, right-clicking the TextBox control launches a standard "edit"
pop-up menu.
Microsoft provides a work-around for the case where you want to launch a
different pop-up menu;

http://support.microsoft.com/default...microsoft.com: 80/support/kb/articles/Q224/3/02.ASP&NoWebContent=1

The work-aound works, but has a near-fatal (in my opinion) flaw, which
Microsoft warns you about; if you end execution of the program without
having de-activated the workaround (via code in an Unload event) the VB IDE itself crashes.

This means;

- When executing your program (in the IDE) you can't use the "Stop/End"
button or VB will crash

and worse

- If you encounter a bug in your program, many times (at least for me)
you're going to get crashed out of VB because the "End" button would crash
you directly, and if you go into "Debug" mode, unless the problem is easy to fix you're ultimately going to do an End (and crash)

Does anyone know of a way to 'work-around this work-around" ?

Thanks a lot,

Bob Kochem


Bob.. to be honest I don't understand why you need to take that route.

You can have whatever menu you want on a right mouse click.

This is what I do:

I create my own "edit" or whatever menu I want to show up on a right mouse
click. I create this regularly on the menu bar but just make it "invisible"
or leave it visible if you want a duplicate menu on edit or right-mouse.

In my Text_MouseDown event, I detect the right mouse, if so, I display the
menu, like so:

Private Sub TextBox1_MouseDown(Button As Integer, Shift As Integer, x As
Single, Y As Single)
If Button = vbRightButton Then
PopupMenu mnuEdit
End If
End Sub

Am I missing something?
Jul 17 '05 #2
"Bob Kochem" <r.******@worldnet.att.net> wrote in message
news:8C*************@nwrdny01.gnilink.net
By default, right-clicking the TextBox control launches a standard
"edit" pop-up menu.
Microsoft provides a work-around for the case where you want to
launch a different pop-up menu; <cut>

go to http://groups.google.com and search for
VB context menu releasecapture
that will get you sample code for killing the default context menu without
major side effects
This means;

- When executing your program (in the IDE) you can't use the
"Stop/End" button or VB will crash
That's good; you should never be using that anyway. It's similar to the VB
END statement in that it doesn't allow normal cleanup of all objects. If
you need to stop an app in the IDE use the "set next statement" and other
options to walk through the code to a clean exit point and/or call cleanup
routiens manually form the immediate window.
and worse

- If you encounter a bug in your program, many times (at least for me)
you're going to get crashed out of VB because the "End" button would
crash you directly, and if you go into "Debug" mode, unless the
problem is easy to fix you're ultimately going to do an End (and
crash)

Does anyone know of a way to 'work-around this work-around" ?


With or without the options for dealing with the context menu issues don't
ever use END or the STOP button

Jul 17 '05 #3

"Bob Kochem" <r.******@worldnet.att.net> wrote in message
news:vC***************@nwrdny02.gnilink.net...
What you are describing works for just about anything *except* TextBox
controls. When you right-click a text-box control, VB enforces that a
standard 'edit' PopUp menu designed by them (not selected by you) gets
displayed.


I see what you mean.. the first click the VB default shows up, the second
click, your menu.

I use this method all the time and it works like a charm. Then again, I
always use a RichTextBox.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: bettyann | last post by:
I am using Visual Basic 6.0. I have a TextBox control whose "Caption" I wish to access. When I look at the TextBox's structure via the "watch" window, its structure appears to look like the...
1
by: Stephen | last post by:
Im trying to do a function to validation two textbox controls. I want the user to enter in text to either txtSurname or txtCompanyName but not both. Is my logic wrong and if so can someone help me...
3
by: Stephen | last post by:
Im trying to do a function to validation two textbox controls. I want the user to enter in text to either txtSurname or txtCompanyName but not both. Is my logic wrong and if so can someone help me...
1
by: Philip Townsend | last post by:
I have a user control that contains a form with several text boxes. The text boxes get populated from a SQL Server table when the control loads. When the controls posts back, any values that have...
0
by: Rogelio Moreno | last post by:
Denis, I recommend you to bind the textbox controls to columns of your table inside your dataset, then get the bindingmanagerbase for the table, then use the position property of the...
3
by: MenuChen | last post by:
First to say,Sorry for my poor English. I want to make a customerize TextBox Controls for my Program.This Control must be like this,when I click the textbox,it can show me the monthCalendar.I know...
0
by: Seok Bee | last post by:
Dear Experts, In my web form, I've a few textbox controls. These controls are to capture date and time. Therefore, I've a calendar link to allow user to make a date and time selection into the...
3
by: keithb | last post by:
My code dynamically adds template fields to a GridView control. Everything seems to work OK, except when updating, because I haven't found a way to reference the dynamically added textboxes....
10
by: Neil | last post by:
Using the MS Rich Textbox Control 6.0 in Access 2000, I need to concatenate several RTB controls into a single RTF file. Sometimes two strings will be side-by-side; other times they need to be...
3
PAHSTeacher
by: PAHSTeacher | last post by:
I have programmed recreationally in VBA for a few years. I am making a simple website with Visual Web Developer 2005 (ASP.NET), using VB (for the first time). I would like to loop through all of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.