Click here to Skip to main content
15,887,746 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: An universal way to backup / Restore database to SQL server from vb.net Pin
Eddy Vluggen24-May-15 0:48
professionalEddy Vluggen24-May-15 0:48 
GeneralRe: An universal way to backup / Restore database to SQL server from vb.net Pin
satc24-May-15 8:19
satc24-May-15 8:19 
GeneralRe: An universal way to backup / Restore database to SQL server from vb.net Pin
Eddy Vluggen24-May-15 8:46
professionalEddy Vluggen24-May-15 8:46 
GeneralRe: An universal way to backup / Restore database to SQL server from vb.net Pin
Mycroft Holmes24-May-15 14:22
professionalMycroft Holmes24-May-15 14:22 
Questionalgorithm for balancing chemical equations Pin
tunglamvghy19-May-15 3:44
tunglamvghy19-May-15 3:44 
AnswerRe: algorithm for balancing chemical equations Pin
Sascha Lefèvre19-May-15 3:52
professionalSascha Lefèvre19-May-15 3:52 
RantRe: algorithm for balancing chemical equations Pin
Brian C Hart19-May-15 8:01
professionalBrian C Hart19-May-15 8:01 
QuestionCustom ContextMenu for TextBox doesn't disable items when necessary Pin
satc18-May-15 23:51
satc18-May-15 23:51 
Hello !
I don't want all the items that a default textbox's context menu contains.
So I'm using a custom context menu :
VB
Dim contextMenu = New ContextMenu()
contextMenu.MenuItems.Add(New MenuItem("Copy", Sub(s, ea) textBox1.Copy()))
contextMenu.MenuItems.Add(New MenuItem("Paste", Sub(s, ea) textBox1.Paste()))
contextMenu.MenuItems.Add(New MenuItem("Undo", Sub(s, ea) textBox1.Undo()))
contextMenu.MenuItems.Add(New MenuItem("Select All", Sub(s, ea) textBox1.SelectAll()))
textBox1.ContextMenu = contextMenu
But the problem is that now , all these commands are always enabled even in some cases when shouldn't be. for example even nothing is copied , the Paste command is enabled. Event the textbox is empty and nothing is selected , the Copy command is enabled.

----Is there a way to fix this behavior ?

----Or maybe is there a way to not use a custom menu . but just to hide the items that I don't want in the default context menu , using TextBox.ConTextMenu.Popup event ?

Thank you !
AnswerRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Eddy Vluggen19-May-15 0:12
professionalEddy Vluggen19-May-15 0:12 
AnswerRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Richard MacCutchan19-May-15 0:12
mveRichard MacCutchan19-May-15 0:12 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
satc19-May-15 6:40
satc19-May-15 6:40 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Richard MacCutchan19-May-15 7:25
mveRichard MacCutchan19-May-15 7:25 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Sascha Lefèvre19-May-15 7:52
professionalSascha Lefèvre19-May-15 7:52 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
satc19-May-15 19:03
satc19-May-15 19:03 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Richard Deeming20-May-15 1:11
mveRichard Deeming20-May-15 1:11 
AnswerRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Terry Dieckmann20-May-15 2:20
Terry Dieckmann20-May-15 2:20 
QuestionVB.net code created by conversion from a working c# code doesn't work Pin
satc18-May-15 23:26
satc18-May-15 23:26 
AnswerRe: VB.net code created by conversion from a working c# code doesn't work Pin
Duncan Edwards Jones18-May-15 23:32
professionalDuncan Edwards Jones18-May-15 23:32 
QuestionCombobox not (re)loading the Datasource Pin
SepPax18-May-15 6:11
SepPax18-May-15 6:11 
QuestionHow to Upload/preview excel sheet file to Datagridview Control Pin
Urassa, Octallon18-May-15 4:00
professionalUrassa, Octallon18-May-15 4:00 
GeneralRe: How to Upload/preview excel sheet file to Datagridview Control Pin
Sascha Lefèvre18-May-15 4:25
professionalSascha Lefèvre18-May-15 4:25 
AnswerRe: How to Upload/preview excel sheet file to Datagridview Control Pin
Richard MacCutchan18-May-15 4:43
mveRichard MacCutchan18-May-15 4:43 
QuestionApplication fail to close when a control created in runtime is used Pin
satc17-May-15 23:53
satc17-May-15 23:53 
GeneralRe: Application fail to close when a control created in runtime is used Pin
Sascha Lefèvre18-May-15 2:22
professionalSascha Lefèvre18-May-15 2:22 
GeneralRe: Application fail to close when a control created in runtime is used Pin
satc18-May-15 7:11
satc18-May-15 7:11 

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.