|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
contextMenu Problem!!!sugestions ? 'Add Items Dim countera As Integer For countera = 0 To 15 Mnu_Sys_over.Items.Add(countera).Tag = countera 'Do i have set the name of the menu item too ? Next 'Check item For z = 0 To Mnu_Sys_over.Items.Count - 1 If Mnu_Sys_over.Items(z).Tag = ListView1.Items(COuntera).Tag Then Dim SelectedMnuItem As New MenuItem(Mnu_Sys_over.Items(z).Text) SelectedMnuItem.Checked = True End If Next zulan***@gmail.com wrote:
> hi tring to make a Menu Item Cheked but it doesn't seem to work, any If you want to...> sugestions ? > > 'Add Items > > Dim countera As Integer > For countera = 0 To 15 > Mnu_Sys_over.Items.Add(countera).Tag = countera > 'Do i have set the name of the menu item too ? > Next This creates a new menu item, sets it to be checked, and then throws it > > > 'Check item > > For z = 0 To Mnu_Sys_over.Items.Count - 1 > If Mnu_Sys_over.Items(z).Tag = > ListView1.Items(COuntera).Tag Then > Dim SelectedMnuItem As New > MenuItem(Mnu_Sys_over.Items(z).Text) > SelectedMnuItem.Checked = True away. Instead of these two lines, you probably mean Mnu_Sys_over.Items(z).Checked = True > End If > Next > -- Larry Lard larryl***@googlemail.com The address is real, but unread - please reply to the group For VB and C# questions - tell us which version Lard ,
well i have tried that but the Mnu_Sys_over.Items(z).Checked does exist ! Error 1 'Checked' is not a member of 'System.Windows.Forms.ToolStripItem'. thank you Larry Lard wrote: Show quoteHide quote > zulan***@gmail.com wrote: > > hi tring to make a Menu Item Cheked but it doesn't seem to work, any > > sugestions ? > > > > 'Add Items > > > > Dim countera As Integer > > For countera = 0 To 15 > > Mnu_Sys_over.Items.Add(countera).Tag = countera > > 'Do i have set the name of the menu item too ? > > If you want to... > > > Next > > > > > > 'Check item > > > > For z = 0 To Mnu_Sys_over.Items.Count - 1 > > If Mnu_Sys_over.Items(z).Tag = > > ListView1.Items(COuntera).Tag Then > > Dim SelectedMnuItem As New > > MenuItem(Mnu_Sys_over.Items(z).Text) > > SelectedMnuItem.Checked = True > > This creates a new menu item, sets it to be checked, and then throws it > away. Instead of these two lines, you probably mean > Mnu_Sys_over.Items(z).Checked = True > > > > End If > > Next > > > > > -- > Larry Lard > larryl***@googlemail.com > The address is real, but unread - please reply to the group > For VB and C# questions - tell us which version You need a cast
CType(Mnu_Sys_over.Items(z), ToolStripMenuItem).Checked = True /claes Show quoteHide quote "Zulander" <zulan***@gmail.com> wrote in message news:1155221738.246452.263970@i3g2000cwc.googlegroups.com... > Lard , > well i have tried that but the > Mnu_Sys_over.Items(z).Checked does exist ! > > Error 1 'Checked' is not a member of > 'System.Windows.Forms.ToolStripItem'. > thank you > > > > Larry Lard wrote: >> zulan***@gmail.com wrote: >> > hi tring to make a Menu Item Cheked but it doesn't seem to work, any >> > sugestions ? >> > >> > 'Add Items >> > >> > Dim countera As Integer >> > For countera = 0 To 15 >> > Mnu_Sys_over.Items.Add(countera).Tag = countera >> > 'Do i have set the name of the menu item too ? >> >> If you want to... >> >> > Next >> > >> > >> > 'Check item >> > >> > For z = 0 To Mnu_Sys_over.Items.Count - 1 >> > If Mnu_Sys_over.Items(z).Tag = >> > ListView1.Items(COuntera).Tag Then >> > Dim SelectedMnuItem As New >> > MenuItem(Mnu_Sys_over.Items(z).Text) >> > SelectedMnuItem.Checked = True >> >> This creates a new menu item, sets it to be checked, and then throws it >> away. Instead of these two lines, you probably mean >> Mnu_Sys_over.Items(z).Checked = True >> >> >> > End If >> > Next >> > >> >> >> -- >> Larry Lard >> larryl***@googlemail.com >> The address is real, but unread - please reply to the group >> For VB and C# questions - tell us which version >
anonymous methods only available in C#?
VB2005 Hiding Windows Forms Setup project in VB.NET ? Help Needed. Update with parameters error - No value given for one or more parameters. declare API without direct file name listView - filling it with datareader determining line numbers upon error How Programatically add to Scheduled tasks OLE: Excel.Application CanGetFocus |
|||||||||||||||||||||||