473,721 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Button Click(ByVal Button As MSComCtlLib.But ton)
On Error Resume Next
ActiveForm.take action (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_Button Click(ByVal eventSender As System.Object, ByVal
eventArgs As AxMSComctlLib.I ToolbarEvents_B uttonClickEvent ) Handles
Toolbar1.Button Click
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?ke yword="vbup2072 "'
ActiveMDIChild. takeaction(even tArgs.Button.Ke y)
End Sub


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

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

Private Sub ToolBar1_Button Click(ByVal sender As System.Object, ByVal e
As System.Windows. Forms.ToolBarBu ttonClickEventA rgs) Handles
ToolBar1.Button Click
' Your active mdi child form is Me.ActiveMdiChi ld
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******** *****@tk2msftng p13.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_Button Click(ByVal Button As MSComCtlLib.But ton)
On Error Resume Next
ActiveForm.take action (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_Button Click(ByVal eventSender As System.Object, ByVal
eventArgs As AxMSComctlLib.I ToolbarEvents_B uttonClickEvent ) Handles
Toolbar1.Button Click
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?ke yword="vbup2072 "'
ActiveMDIChild. takeaction(even tArgs.Button.Ke y)
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***@bellsout h.net> 撰寫於郵件新聞: %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.ActiveMdiChi ld from the
mdi parent to get the active child

Private Sub ToolBar1_Button Click(ByVal sender As System.Object, ByVal e
As System.Windows. Forms.ToolBarBu ttonClickEventA rgs) Handles
ToolBar1.Button Click
' Your active mdi child form is Me.ActiveMdiChi ld
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******** *****@tk2msftng p13.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_Button Click(ByVal Button As MSComCtlLib.But ton)
On Error Resume Next
ActiveForm.take action (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_Button Click(ByVal eventSender As System.Object,
ByVal eventArgs As AxMSComctlLib.I ToolbarEvents_B uttonClickEvent ) Handles
Toolbar1.Button Click
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?ke yword="vbup2072 "'
ActiveMDIChild. takeaction(even tArgs.Button.Ke y)
End Sub


Thanks and best regards.
Miles


Nov 21 '05 #3
Thanks. :)
Private Sub Toolbar1_Button Click(ByVal eventSender As System.Object, ByVal
eventArgs As AxMSComctlLib.I ToolbarEvents_B uttonClickEvent ) Handles
Toolbar1.Button Click

me.activeChild. takeAction(e.bu tton)?????????? ?????????

End Sub
Thanks and best regards. Miles Hong Full Com i Tech Tel: 2334-1363 (mobile:
60205364) Fax: 2334-8263
"Ken Tucker [MVP]" <vb***@bellsout h.net> 撰寫於郵件新聞: %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.ActiveMdiChi ld from the
mdi parent to get the active child

Private Sub ToolBar1_Button Click(ByVal sender As System.Object, ByVal e
As System.Windows. Forms.ToolBarBu ttonClickEventA rgs) Handles
ToolBar1.Button Click
' Your active mdi child form is Me.ActiveMdiChi ld
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******** *****@tk2msftng p13.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_Button Click(ByVal Button As MSComCtlLib.But ton)
On Error Resume Next
ActiveForm.take action (Button.Key)
End Sub

---------.Net--------------------------------------------------------------------------------
Private Sub Toolbar1_Button Click(ByVal eventSender As System.Object,
ByVal eventArgs As AxMSComctlLib.I ToolbarEvents_B uttonClickEvent ) Handles
Toolbar1.Button Click
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?ke yword="vbup2072 "'
ActiveMDIChild. takeaction(even tArgs.Button.Ke y)
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
65758
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 remove them? If the browser is Netscape I can use javascript: window.toolbar.visible = false; window.menubar.visible = false; but IE produces the error: "'window.toolbar.visible' is null or not an object".
7
2355
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 tab control (very similar to outlook express). I then started coding and realised that I needed to add a ToolBar. When I added this, it didn't appear at the top as expected, but at the top of the tab control and I couldn't get it to appear where...
0
1283
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 add a toolbar to my application, and I want to process the notification messages from the toolbar within my active child form. Is there a way to merge my child form's toolbar with the main form's toolbar? Thanks
5
3237
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 two possible scenarios here, the first one works properly, while the 2nd one doesn't. Scenario 1 ----------
2
5718
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 somewhere on the toolbar itself. It seems it needs to have the focus before tooltips will show. Any ideas? Greg
9
1796
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 image. The images were still invisible. What is the trick? I asked this question a while ago. Thanks.
1
3546
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 toolbar. Add a button and make it's style dropdown. In the code I create a contextmenu and add three items. This is all fine. But when I click on one of the menu items I can't figure out how to know it's been clicked and what menu item it is.
6
3128
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 ToolbarButtons... Does anyone know how this could be done? Looking forward to hear from you,
4
3656
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 to be able to control the toolbar from another form. Forms!frmClipping!Toolbar1.Buttons(2).Clicked = True does not work. Does anybody have any ideas how to do this? Gerhard
6
3899
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 we have a standard toolbar that is at the top of the form window. It contains about 8 buttons that use images from an imagelist. Sometimes we hide buttons thru the code. When a button is hidden, i assumed that it wasn't clickable. It appears
0
8858
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8738
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9376
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8026
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6678
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2596
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2146
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.