Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vb.net call a sub

Posted on 2010-08-31
10
Medium Priority
?
480 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 1500 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

971 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