473,396 Members | 1,938 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,396 software developers and data experts.

Toolbar and MDI form

Hi there. Thanks for help in advance.

I have an mdi form, with a toolbar.
When i click on the toolbar button, i want to call the sub
of "active mdi child" form's "Action" module, with the button.index passed.

for each "mdi child form", i have defined the module:
sub Action(byval buttonIndex as integer)
case of buttonIndex
take the actions
end sub
for VB6, i know how to make it.
however, when i make the test project be upgraded to vb.net,
---------VB6--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
On Error Resume Next
ActiveForm.takeaction (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal eventSender As System.Object, ByVal
eventArgs As AxMSComctlLib.IToolbarEvents_ButtonClickEvent) Handles
Toolbar1.ButtonClick
On Error Resume Next
'UPGRADE_ISSUE: Control takeaction could not be resolved because it was
within the generic namespace ActiveMDIChild. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2072"'
ActiveMDIChild.takeaction(eventArgs.Button.Key)
End Sub


Thanks and best regards.
Miles
Nov 21 '05 #1
3 6252
Hi,

There no longer is an index property with the toolbar button. Use
e.button is toolbarbutton then. You can use Me.ActiveMdiChild from the mdi
parent to get the active child

Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
ToolBar1.ButtonClick
' Your active mdi child form is Me.ActiveMdiChild
If e.Button Is ToolBarButton1 Then
' do something
ElseIf e.Button Is ToolBarButton2 Then
' do something else
ElseIf e.Button Is ToolBarButton3 Then
' your other code
End If
End Sub
Ken
--------------
"Smiles" <no@directreply.com> wrote in message
news:en*************@tk2msftngp13.phx.gbl...
Hi there. Thanks for help in advance.

I have an mdi form, with a toolbar.
When i click on the toolbar button, i want to call the sub
of "active mdi child" form's "Action" module, with the button.index
passed.

for each "mdi child form", i have defined the module:
sub Action(byval buttonIndex as integer)
case of buttonIndex
take the actions
end sub
for VB6, i know how to make it.
however, when i make the test project be upgraded to vb.net,
---------VB6--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
On Error Resume Next
ActiveForm.takeaction (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal eventSender As System.Object, ByVal
eventArgs As AxMSComctlLib.IToolbarEvents_ButtonClickEvent) Handles
Toolbar1.ButtonClick
On Error Resume Next
'UPGRADE_ISSUE: Control takeaction could not be resolved because it was
within the generic namespace ActiveMDIChild. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2072"'
ActiveMDIChild.takeaction(eventArgs.Button.Key)
End Sub


Thanks and best regards.
Miles

Nov 21 '05 #2
Thanks, Ken.
my problem is how to call the mdiChild's "take action" module in
the mdiParent form.

Thanks again.

Miles

Thanks and best regards. Miles Hong Full Com i Tech Tel: 2334-1363 (mobile:
60205364) Fax: 2334-8263
"Ken Tucker [MVP]" <vb***@bellsouth.net> ¼¶¼g©ó¶l¥ó·s»D:%2***************@TK2MSFTNGP15.phx. gbl...
Hi,

There no longer is an index property with the toolbar button. Use
e.button is toolbarbutton then. You can use Me.ActiveMdiChild from the
mdi parent to get the active child

Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
ToolBar1.ButtonClick
' Your active mdi child form is Me.ActiveMdiChild
If e.Button Is ToolBarButton1 Then
' do something
ElseIf e.Button Is ToolBarButton2 Then
' do something else
ElseIf e.Button Is ToolBarButton3 Then
' your other code
End If
End Sub
Ken
--------------
"Smiles" <no@directreply.com> wrote in message
news:en*************@tk2msftngp13.phx.gbl...
Hi there. Thanks for help in advance.

I have an mdi form, with a toolbar.
When i click on the toolbar button, i want to call the sub
of "active mdi child" form's "Action" module, with the button.index
passed.

for each "mdi child form", i have defined the module:
sub Action(byval buttonIndex as integer)
case of buttonIndex
take the actions
end sub
for VB6, i know how to make it.
however, when i make the test project be upgraded to vb.net,
---------VB6--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
On Error Resume Next
ActiveForm.takeaction (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal eventSender As System.Object,
ByVal eventArgs As AxMSComctlLib.IToolbarEvents_ButtonClickEvent) Handles
Toolbar1.ButtonClick
On Error Resume Next
'UPGRADE_ISSUE: Control takeaction could not be resolved because it was
within the generic namespace ActiveMDIChild. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2072"'
ActiveMDIChild.takeaction(eventArgs.Button.Key)
End Sub


Thanks and best regards.
Miles


Nov 21 '05 #3
Thanks. :)
Private Sub Toolbar1_ButtonClick(ByVal eventSender As System.Object, ByVal
eventArgs As AxMSComctlLib.IToolbarEvents_ButtonClickEvent) Handles
Toolbar1.ButtonClick

me.activeChild.takeAction(e.button)??????????????? ????

End Sub
Thanks and best regards. Miles Hong Full Com i Tech Tel: 2334-1363 (mobile:
60205364) Fax: 2334-8263
"Ken Tucker [MVP]" <vb***@bellsouth.net> ¼¶¼g©ó¶l¥ó·s»D:%2***************@TK2MSFTNGP15.phx. gbl...
Hi,

There no longer is an index property with the toolbar button. Use
e.button is toolbarbutton then. You can use Me.ActiveMdiChild from the
mdi parent to get the active child

Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
ToolBar1.ButtonClick
' Your active mdi child form is Me.ActiveMdiChild
If e.Button Is ToolBarButton1 Then
' do something
ElseIf e.Button Is ToolBarButton2 Then
' do something else
ElseIf e.Button Is ToolBarButton3 Then
' your other code
End If
End Sub
Ken
--------------
"Smiles" <no@directreply.com> wrote in message
news:en*************@tk2msftngp13.phx.gbl...
Hi there. Thanks for help in advance.

I have an mdi form, with a toolbar.
When i click on the toolbar button, i want to call the sub
of "active mdi child" form's "Action" module, with the button.index
passed.

for each "mdi child form", i have defined the module:
sub Action(byval buttonIndex as integer)
case of buttonIndex
take the actions
end sub
for VB6, i know how to make it.
however, when i make the test project be upgraded to vb.net,
---------VB6--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
On Error Resume Next
ActiveForm.takeaction (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal eventSender As System.Object,
ByVal eventArgs As AxMSComctlLib.IToolbarEvents_ButtonClickEvent) Handles
Toolbar1.ButtonClick
On Error Resume Next
'UPGRADE_ISSUE: Control takeaction could not be resolved because it was
within the generic namespace ActiveMDIChild. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2072"'
ActiveMDIChild.takeaction(eventArgs.Button.Key)
End Sub


Thanks and best regards.
Miles


Nov 21 '05 #4

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

Similar topics

15
by: Code Monkee | last post by:
How can the toolbar and menubar be hidden in IE? When opening the window via javascript I can specify 'toolbar=no,menubar=no', which works fine. However if the window already exists how can I...
7
by: Andy Bates | last post by:
I have hopefully a simple problem in C#. I designed a form with a listview on left, vert splitter against that, then the remainder of the form from top to bottom: a listview, horiz splitter and...
0
by: AliR | last post by:
Hi everyone, I am writing an MDI application, and I just learned how to merge my child form's menu with the parent, so I can handle the menu notifications with in the child form. Now I want to...
5
by: anthony.duerr | last post by:
I have encountered a problem (most certainly a .NET bug), that, for the life of me, I cannot figure out how to work around. Using Visual Studio 2003, with enabled XP Visual Styles. There are...
2
by: Greg Burns | last post by:
I added a toolbar to a form and added one button. I made sure ShowToolTips = true for the Toolbar, and have set a tooltip for the button. The problem is the tooltip only shows after clicking...
9
by: Hugh | last post by:
after I changed the image size. I tried different combinations of images sizes and button sizes. I have tried both botton and the image in the same sizes or button size was larger than that of...
1
by: Curtis | last post by:
Somehow I'm just missing something. I don't know how to catch when a user clicks on an item in a dropdown list for a dropdown style button on a toolbar. I create a new app. Form1. Add a...
6
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for...
4
by: Gerhard | last post by:
I have an MS Access app with multiple forms. One of the forms has a Toolbar (MsComctlLib.Toolbar) and it works as advertised. I handle the buttons in the Toolbar1_ButtonClick event. I would like...
6
by: =?Utf-8?B?L2Rldi9udWxs?= | last post by:
Hello, i am using visual studio 2003 enterprise architect version. I am making apps for the .Net framework 1.1. While testing an interface, i discovered something strange. In this application...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.