Click here to Skip to main content
15,899,474 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionFocus in RichTextBox Pin
Taen_Karth13-Sep-05 17:57
Taen_Karth13-Sep-05 17:57 
AnswerRe: Focus in RichTextBox Pin
Steve Pullan13-Sep-05 21:23
Steve Pullan13-Sep-05 21:23 
QuestionString and Object Pin
militiaware13-Sep-05 15:31
militiaware13-Sep-05 15:31 
AnswerRe: String and Object Pin
rwestgraham13-Sep-05 15:45
rwestgraham13-Sep-05 15:45 
QuestionExcel and vbscript Pin
netmeister13-Sep-05 11:32
netmeister13-Sep-05 11:32 
Questionautomate saving a web page? Pin
gtjr9213-Sep-05 8:36
gtjr9213-Sep-05 8:36 
QuestionDynamic Context Menu Pin
No-e13-Sep-05 8:26
No-e13-Sep-05 8:26 
AnswerRe: Dynamic Context Menu Pin
Steve Pullan13-Sep-05 13:36
Steve Pullan13-Sep-05 13:36 
Part of the solution is to define the menu item objects WithEvents thus:
Dim WithEvents MenuItem1 As New System.Windows.Forms.MenuItem
Dim WithEvents MenuItem2 As New System.Windows.Forms.MenuItem
Dim WithEvents MenuItem3 ... etc.

You'll then be able to trap the MenuItemx_Click() events.

A couple of drawbacks though: you cannot define local objects WithEvents, nor can WithEvents be associated with arrays so you'll need to define a bunch of menu item objects with global scope within your class to cater for the maximum number of expected menu items in your config file.

I have had no reason to do dynamic context menus so I'd also be interested in other people's solutions.


...Steve

-- modified at 19:38 Tuesday 13th September, 2005
AnswerRe: Dynamic Context Menu Pin
Briga15-Sep-05 23:23
Briga15-Sep-05 23:23 
QuestionVisual Basic .NET Standard vs. SQL Server 2000 Developer Edition Pin
medicenpringles13-Sep-05 8:18
medicenpringles13-Sep-05 8:18 
AnswerRe: Visual Basic .NET Standard vs. SQL Server 2000 Developer Edition Pin
Dave Kreskowiak13-Sep-05 8:50
mveDave Kreskowiak13-Sep-05 8:50 
GeneralRe: Visual Basic .NET Standard vs. SQL Server 2000 Developer Edition Pin
medicenpringles13-Sep-05 9:41
medicenpringles13-Sep-05 9:41 
GeneralRe: Visual Basic .NET Standard vs. SQL Server 2000 Developer Edition Pin
Dave Kreskowiak13-Sep-05 12:32
mveDave Kreskowiak13-Sep-05 12:32 
QuestionMoving from Web Development to Windows Pin
Anonymous13-Sep-05 8:15
Anonymous13-Sep-05 8:15 
AnswerRe: Moving from Web Development to Windows Pin
Dave Kreskowiak13-Sep-05 8:46
mveDave Kreskowiak13-Sep-05 8:46 
QuestionReturn the filename of an image in a picturebox Pin
smith342113-Sep-05 5:43
smith342113-Sep-05 5:43 
AnswerRe: Return the filename of an image in a picturebox Pin
Dave Kreskowiak13-Sep-05 5:58
mveDave Kreskowiak13-Sep-05 5:58 
QuestionFinding my mummy Pin
Mark0613-Sep-05 1:27
Mark0613-Sep-05 1:27 
AnswerRe: Finding my mummy Pin
Dave Kreskowiak13-Sep-05 4:22
mveDave Kreskowiak13-Sep-05 4:22 
GeneralRe: Finding my mummy Pin
Mark0613-Sep-05 5:58
Mark0613-Sep-05 5:58 
GeneralRe: Finding my mummy Pin
Dave Kreskowiak13-Sep-05 6:26
mveDave Kreskowiak13-Sep-05 6:26 
GeneralRe: Finding my mummy Pin
Mark0613-Sep-05 10:42
Mark0613-Sep-05 10:42 
GeneralRe: Finding my mummy Pin
Beaniiman13-Sep-05 12:05
Beaniiman13-Sep-05 12:05 
GeneralRe: Finding my mummy Pin
Dave Kreskowiak13-Sep-05 12:44
mveDave Kreskowiak13-Sep-05 12:44 
GeneralRe: Finding my mummy Pin
Mark0613-Sep-05 13:17
Mark0613-Sep-05 13:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.