Solved

vb.net call a sub

Posted on 2010-08-31
10
476 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
Independent Software Vendors: 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 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