Solved

vb.net call a sub

Posted on 2010-08-31
10
473 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

822 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