473,405 Members | 2,261 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,405 software developers and data experts.

How to invoke an object method

Hi.

How can I invoke the "Text1_LostFocus()" method within the "Button1_Clik()"
method? Or wath parameters should I pass?

Thanks in advance.

Jul 21 '05 #1
4 1401

You can pass simply call it this way:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Text1_LostFocus(Nothing, Nothing)
End Sub

"FeOl" <Fe**@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
Hi.

How can I invoke the "Text1_LostFocus()" method within the
"Button1_Clik()"
method? Or wath parameters should I pass?

Thanks in advance.

Jul 21 '05 #2
I would suggest not calling event handlers directly. That is bad
programming style. Rather, you should have some methods that handle all the
functionality that you desire. Then have each even handler call those
methods as appropriate.

"gaidar" <ga****@vbstreets.ru> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...

You can pass simply call it this way:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Text1_LostFocus(Nothing, Nothing)
End Sub

"FeOl" <Fe**@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
Hi.

How can I invoke the "Text1_LostFocus()" method within the
"Button1_Clik()"
method? Or wath parameters should I pass?

Thanks in advance.


Jul 21 '05 #3
Man, what a simple solution!!! I've being looking in Help, traying to
understand Delgates, Event Handlers, etc. You save me a lot of work.

¡Thanks a lot! Regards from México.

Fernando Olvera
"gaidar" escribió:

You can pass simply call it this way:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Text1_LostFocus(Nothing, Nothing)
End Sub

"FeOl" <Fe**@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
Hi.

How can I invoke the "Text1_LostFocus()" method within the
"Button1_Clik()"
method? Or wath parameters should I pass?

Thanks in advance.


Jul 21 '05 #4
Thanks for the comment, Peter.
"Peter Rilling" escribió:
I would suggest not calling event handlers directly. That is bad
programming style. Rather, you should have some methods that handle all the
functionality that you desire. Then have each even handler call those
methods as appropriate.

"gaidar" <ga****@vbstreets.ru> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...

You can pass simply call it this way:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Text1_LostFocus(Nothing, Nothing)
End Sub

"FeOl" <Fe**@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
Hi.

How can I invoke the "Text1_LostFocus()" method within the
"Button1_Clik()"
method? Or wath parameters should I pass?

Thanks in advance.



Jul 21 '05 #5

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

Similar topics

1
by: boxim | last post by:
hi all, I'm having a few problems whereby my application is hanging when using the Invoke method of a form's control. Basically, when a user clicks a button on the form, it calls a remote...
5
by: RickDee | last post by:
Please help, anybody. I am trying to write a program so that it can launch an exe file ( which is also genereated in C# ) and then simulate the button clicking and invoke the methods inside the...
2
by: rawCoder | last post by:
Hi I am having this InvalidOperationException with message Cannot call Invoke or InvokeAsync on a control until the window handle has been created This is raised when i try to invoke a method...
3
by: Manfred Braun | last post by:
Hi All, I am able to invoke some methods from an instance of a loaded assembly, but I am not able to invoke the loaded assemblie's "Main" method. I try it this way: Assembly assembly =...
14
by: stic | last post by:
Hi, I'm in a middle of writing something like 'exception handler wraper' for a set of different methodes. The case is that I have ca. 40 methods form web servicem, with different return values...
19
by: trint | last post by:
Ok, I start my thread job: Thread t = new Thread(new ThreadStart(invoicePrintingLongRunningCodeThread)); t.IsBackground = true; t.Start(); There are lots of calls to controls and many...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the...
3
by: Me | last post by:
I am trying to figure out any issues with calling System.Reflection.MethodInfo.Invoke() when dealing with multiple threads. For instance.. Say I have a class that allows you to pass in a...
2
by: =?Utf-8?B?a2VubmV0aG1Abm9zcGFtLm5vc3BhbQ==?= | last post by:
vs2005, c# Trying to understand why one way works but the other doesnt. I have not tried to create a simpler mdi/child/showdialog app for posting purposes (I think even this would not be so small...
3
balabaster
by: balabaster | last post by:
I have a class that I want to make thread-safe and am investigating the ISyncronizeInvoke interface and wondering just what it will take to implement this interface. So far the basic concept of my...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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
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,...
0
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...

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.