| | |
how to call an event inside another event
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
Lets say that in the loadmain you set text for a label like this
Label1.Text = "Load Main"
But you want to do the same thing if you click a button, then create a function called for example
then your load main will have this
and the button event
I hope you understand the idea. regards
Label1.Text = "Load Main"
But you want to do the same thing if you click a button, then create a function called for example
VBNET Syntax (Toggle Plain Text)
private void SetLabel() { Label1.Text = "Load Main" }
VBNET Syntax (Toggle Plain Text)
private void LoadMain() { SetLabel() }
VBNET Syntax (Toggle Plain Text)
private void buttonevent() { SetLabel() }
I hope you understand the idea. regards
If your already resolved your issue, flag it as solved.
José Bisonó
José Bisonó
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
VB.NET Syntax (Toggle Plain Text)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try MsgBox("Form Load") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Call Form1_Load(sender, e) Catch ex As Exception MsgBox(ex.Message) End Try End Sub
But i suggest u to write the form load code into procedure,& call that procedure on form load & on button click,instead of calling form load event again
![]() |
Similar Threads
- Call a function by onclick event (PHP)
- wx Event Help (Python)
- How to acces Command Object in ADO executeComplete event (C++)
- Re-running an onload event (JavaScript / DHTML / AJAX)
- How to capture ASP.NET2.0 control's event at client side (ASP.NET)
- Selecting text event in RichTextBox (VB.NET)
- onclick dropdown event (ASP.NET)
- Timer event doesn't get triggered (C++)
Other Threads in the VB.NET Forum
- Previous Thread: Problem with button
- Next Thread: How to drag/drop labels ,that created at run time
| Thread Tools | Search this Thread |
.net .net2008 2008 access advanced application array basic beginner browser button buttons center click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function generatetags html images input intel internet listview map mobile module monitor msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read regex remove right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol vb vb.net vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms winsock wpf wrapingcode xml year





