I've either completely forgotten how to do this or it's different in
VB.Net from VB6, but how do I call the routine for a menu click
programmatically? (ie I want to simulate and call mnuTest_click). I
don't know what arguments to supply in the call.
TIA
John Dann 8 1941
Hi John,
You only have to call the event method that does the mnuTest_Click and
because you have to give the arguments is the most simple for that
mnuTest_Click(Nothing,Nothing)
(There are more methods so probably you get 4 others as well, this is the
most simple one in my opinion)
Cor I've either completely forgotten how to do this or it's different in VB.Net from VB6, but how do I call the routine for a menu click programmatically? (ie I want to simulate and call mnuTest_click). I don't know what arguments to supply in the call.
TIA John Dann
Cor,
* "Cor Ligthert" <no**********@planet.nl> scripsit: You only have to call the event method that does the mnuTest_Click and because you have to give the arguments is the most simple for that
mnuTest_Click(Nothing,Nothing)
(There are more methods so probably you get 4 others as well, this is the most simple one in my opinion)
Mhm... What if I want to get the reference to the item in the 'sender'
parameter of the handler? Passing 'Nothing' to the handler is IMO not
the best idea.
Just my 2 Euro cents...
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
* John Dann <ne**@prodata.co.uk> scripsit: I've either completely forgotten how to do this or it's different in VB.Net from VB6, but how do I call the routine for a menu click programmatically? (ie I want to simulate and call mnuTest_click). I don't know what arguments to supply in the call.
Call the 'MenuItem''s 'PerformClick' method.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Herfried, You only have to call the event method that does the mnuTest_Click and because you have to give the arguments is the most simple for that
mnuTest_Click(Nothing,Nothing)
(There are more methods so probably you get 4 others as well, this is
the most simple one in my opinion)
Mhm... What if I want to get the reference to the item in the 'sender' parameter of the handler? Passing 'Nothing' to the handler is IMO not the best idea.
With the menu item for a newbie in VBNet? Before he can use the sender
object from the menu item he is already that far that he knows how to do it
with other objects, and the eventargument from the *click* event is not the
one that I have ever used.
However I did not say it was the best method, I said the most simple and
special in this case I think.
:-)
Cor
Herfried,
Then just send a reference to the control you want to use as the sender.
You can also create an instance of the event args and populate them if you
want to.
Then the event method won't be able to tell if the event was fired from
inside the control or created within your application.
-Sam Matzen
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e3**************@tk2msftngp13.phx.gbl... Cor,
* "Cor Ligthert" <no**********@planet.nl> scripsit: You only have to call the event method that does the mnuTest_Click and because you have to give the arguments is the most simple for that
mnuTest_Click(Nothing,Nothing)
(There are more methods so probably you get 4 others as well, this is
the most simple one in my opinion)
Mhm... What if I want to get the reference to the item in the 'sender' parameter of the handler? Passing 'Nothing' to the handler is IMO not the best idea.
Just my 2 Euro cents...
-- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/>
* "Samuel L Matzen" <sm*****@slm.com> scripsit: Then just send a reference to the control you want to use as the sender.
You can also create an instance of the event args and populate them if you want to.
Then the event method won't be able to tell if the event was fired from inside the control or created within your application.
ACK, but then I would use 'PerformClick' instead ;-).
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Herfried,
Selective answering? * "Samuel L Matzen" <sm*****@slm.com> scripsit: Then just send a reference to the control you want to use as the sender.
You can also create an instance of the event args and populate them if
you want to.
Then the event method won't be able to tell if the event was fired from inside the control or created within your application.
ACK, but then I would use 'PerformClick' instead ;-).
-- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/>
Cor,
* "Cor Ligthert" <no**********@planet.nl> scripsit: Selective answering?
???
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Pedro Sebastiao |
last post by:
I need in urgence a program that simulates multiple mouse clicks in a
windows xp application.
I would appreciate if someone could send it to me.
pedro.sebastiao@iol.pt
|
by: Anand Ganesh |
last post by:
Hi All,
When the user right clicks on the desktop or selects a file and right clicks
the mouse he should see our own submenu along with the Windows context menu.
How will I do this in Visual C#...
|
by: Mojtaba Faridzad |
last post by:
Hi,
I have two menu groups; MainMenu and EditMenu. MainMenu includes: New, Edit,
Delete, ... and EditMenu includes: Save and Cancel. the current menu is
MainMenu. when user clicks on New menu,...
|
by: Ignacio X. Domínguez |
last post by:
Hi everyone. Hope you can help me out on this one.
I'm developing a Component which has a property ContextMenu. This component,
when placed on a form with a working ContextMenu (events assigned...
|
by: Andrew Teece |
last post by:
HELP!
I am calling a webservice as a result of an event in an infragistics control
(well, various controls). Problem is that if a user clicks around the GUI
alot, then my code crashes (because...
| |
by: Paul E Collins |
last post by:
A context menu is created in the scope of the RightClick event, but it
continues to be displayed after that event handler terminates - i.e.
after it has gone out of scope. The code works correctly,...
|
by: =?Utf-8?B?QW5kcmV3?= |
last post by:
Hi, friends,
I am using C#.net 2005 to create a windows application.
It has menu items, such as File, etc.
Under File, there are more menu items, such as New Files, Working Files, etc.
Under...
|
by: daydream |
last post by:
yeah i need some help(such a common line) ,i have a menu and each link has its own div respectively and yeah obviously when u click the link the div shows, the problem is i would like each div to...
|
by: Mike |
last post by:
Here is my scenario. I just took over an existing asp site that is using a
treeview menu on the pages. The treeview is an include file that is an
include that is on every page. The issue is, when...
|
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,...
|
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...
| |
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...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |