ahsansalman
New member
- Joined
- Oct 1, 2007
- Messages
- 1
- Programming Experience
- 1-3
Hi,
I encountered a problem, I added context menu strip with collection of four items. I used this context menu strip for Tab Control. Now I want to select one of the four options(i.e Radio Checking) from Context menu strip. Such that when I checked one of the four items then other three should be unchecked. I don't want to do this by typical coding like to check selected item and unchecked others.
I want some efficiency, and I have a logic to do so, such as I can create a sub procedure in a module where I passed context menu item as ToolStripMenuItem and context menu strip object, and check that which of the item(sender) is passed in context menu strip. the sample code is as Follows :
Public Sub RadioCheckPro(ByVal ctxmenu as ContextMenuStrip, _
ByVal ctxmenuitem as ToolStripMenuItem)
Dim item as MenuItem
For Each Item in ContextMenuStrip
if item Is ToolStripMenuItem then
item.checked = true
else
item.checked = false
Next
End Sub
>..........Now we can call this from main form, but this works properly in .Net 2003 with some control names changing, but it doesn't work in .Net 2.0 .
If anyone of you can give me the better idea then it will be my pleasure, or if you can solve this then ... thanks
Bye
I encountered a problem, I added context menu strip with collection of four items. I used this context menu strip for Tab Control. Now I want to select one of the four options(i.e Radio Checking) from Context menu strip. Such that when I checked one of the four items then other three should be unchecked. I don't want to do this by typical coding like to check selected item and unchecked others.
I want some efficiency, and I have a logic to do so, such as I can create a sub procedure in a module where I passed context menu item as ToolStripMenuItem and context menu strip object, and check that which of the item(sender) is passed in context menu strip. the sample code is as Follows :
Public Sub RadioCheckPro(ByVal ctxmenu as ContextMenuStrip, _
ByVal ctxmenuitem as ToolStripMenuItem)
Dim item as MenuItem
For Each Item in ContextMenuStrip
if item Is ToolStripMenuItem then
item.checked = true
else
item.checked = false
Next
End Sub
>..........Now we can call this from main form, but this works properly in .Net 2003 with some control names changing, but it doesn't work in .Net 2.0 .
If anyone of you can give me the better idea then it will be my pleasure, or if you can solve this then ... thanks
Bye