Solved

vb.net call a sub

Posted on 2010-08-31
10
475 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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