Solved

vb.net call a sub

Posted on 2010-08-31
10
465 Views
Last Modified: 2012-05-10
Hi,

in some of process
.......
.......
ListCom_SelectedIndexChanged

How could I call a sub ListCom_SelectedIndexChanged without arg eventSender , eventArgs ?

Thank you!
Francis SZE
Private Sub ListCom_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles ListCom.SelectedIndexChanged
        rsCusObj.MoveFirst()
        rsCusObj.Move((ListCom.SelectedIndex))
        loadRecordSet()
    End Sub

Open in new window

0
Comment
Question by:fsze88
  • 4
  • 3
  • 3
10 Comments
 
LVL 8

Accepted Solution

by:
Mikkk earned 500 total points
ID: 33565534
try:

call ListCom_SelectedIndexChanged(nothing,nothing)
0
 
LVL 17

Expert Comment

by:nepaluz
ID: 33565751
Chane the value of ListCom

if it is a combobox, determine the index of the currently selected value and select another index in the list. That should fire off the selectedIndexChanged event
0
 
LVL 15

Author Comment

by:fsze88
ID: 33565753
hi
I want given with System.Object, ByVal eventArgs As System.EventArgs
it works on
Call ListCom_SelectedIndexChanged(ListCom, Nothing)
How about eventargs? I want a event "onclick"....

Could you help?

Thank you!
Francis SZE
0
 
LVL 15

Author Comment

by:fsze88
ID: 33568528
hi,
I want to passing onclick event to second parameter on ListCom_SelectedIndexChanged sub

Call ListCom_SelectedIndexChanged(ListCom, ??)

anybody could help?
0
 
LVL 8

Expert Comment

by:Mikkk
ID: 33570397
Yo can do this way, but you can't pass an onclick event.

Dim e As New System.EventArgs()
Call ListCom_SelectedIndexChanged(ListCom, e)

Why do you need "e" to be a real argument?
Yo can pass nothing instead.

Can you explain what do you want to achieve?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 17

Expert Comment

by:nepaluz
ID: 33570953
if you can post more code to highlight what you are trying to achieve someone may point you in the right direction. As it stands, you are asking us to look for "something" that you can't find in the proverbial haystack!
0
 
LVL 15

Author Comment

by:fsze88
ID: 33573381
I want to know how to pass eventargs to sub ListCom_SelectedIndexChanged in the case what I need .
0
 
LVL 17

Expert Comment

by:nepaluz
ID: 33573859
You CAN NOT!
0
 
LVL 8

Expert Comment

by:Mikkk
ID: 33574128
you can call it this way

Dim e As New System.EventArgs()
Call ListCom_SelectedIndexChanged(ListCom, e)

But you can't define "e" as a onclick event becuse events are generated by the system.

For the piece of code you pasted on the question, you don't need this event to be initialized, so if you pass "nothing" will work fine
0
 
LVL 15

Author Closing Comment

by:fsze88
ID: 33574881
.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now