473,586 Members | 2,682 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ListBox, How to force a Click...

Hi,

Hi have a Listbox whith some values but I want to select
the first line and execute the routine on_click.
I selected allready the list value, but how can Y force
the click event?

Thanks for your help
Bernardo
Nov 15 '05 #1
3 5267
"Bernardo" <an*******@disc ussions.microso ft.com> wrote in message
news:07******** *************** *****@phx.gbl
Hi,

Hi have a Listbox whith some values but I want to select
the first line and execute the routine on_click.
I selected allready the list value, but how can Y force
the click event?


Even if you can, would it not be better to move the code to another
procedure and have both the on_click event and your selection code call
that?

--
C# newbie... posts are probably inaccurate, inelegant or both

Nov 15 '05 #2
Just try to call the function "listBox_Click" * from function where you
selected list value...
---------
*listBox is the name of your's list box

"Bernardo" <an*******@disc ussions.microso ft.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Hi,

Hi have a Listbox whith some values but I want to select
the first line and execute the routine on_click.
I selected allready the list value, but how can Y force
the click event?

Thanks for your help
Bernardo

Nov 15 '05 #3
Hi bernardo,

If you have the OnSelectedIndex Change event of the listbox hooked to a
method then if you change the SelectedIndex property it automatically call
the handlers. Yo do not need to call them !!!

See that there is not an OnClick event for the listbox class.
Happy new Year,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Bernardo" <an*******@disc ussions.microso ft.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Hi,

Hi have a Listbox whith some values but I want to select
the first line and execute the routine on_click.
I selected allready the list value, but how can Y force
the click event?

Thanks for your help
Bernardo

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7859
by: R.Wieser | last post by:
Hello All, I'm trying to get a "Virtual Listbox" to work. I've currently got a form, and used CreateWindowExA to create a ListBox with the LBS_OWNERDRAWFIXED and LBS_NODATA flags on it. I've allso subclassed the window and do see all kinds of WS_??? messages coming by. But now I'm stuck :-\ I've got *no* idea what to do next, and all...
4
42706
by: Filips Benoit | last post by:
Dear All, I have code that selects - find and select - 1 item in a large listbox. This works Ok but most of the time the selected item isn't visible without scrolling down manualy. Is this possible by code? Filip
8
2873
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in this listbox but I can't for the life of me figure out how to draw the control inside ListBox... I get as far as: private void...
5
2422
by: John Veldthuis | last post by:
My code works perfectly 100% when adding items to my ArrayList and updating the listbox. Works perfectly when deleting an item in the ArrayList when it is not the last entry but if it is the last entry and you select another index it goes boom!!!. Funny thing is the SelectedIndex Changed routine fires off perfectly and then crash after the...
3
14422
by: superjacent | last post by:
Hope someone can help. I have a listbox displaying time periods in blocks of 15 mins for a 24 hour period, all up 96 rows. The listbox can only visibly show 20 rows a time. The default feature is that the first row is at the top of the listbox.
18
4594
by: Zytan | last post by:
I want the same function to be run whether you press Enter or double click the listbox. It seems really verbose to write both handlers to both events everytime, even if they both call the same function, or one calls the other. Isn't there an event for 'ListBox selection selected' that is automatically called by ALL the standard GUI ways of...
5
20157
by: Randy | last post by:
I have button that deletes items from a SQL datatable. The items are displayed for the user in listbox, which is bound to the dataset. The code works just fine insofar as it deletes the correct record from the dataset and the datasource. What I need to make it do is to refresh the listbox so that it reflects that the record has been...
5
2841
by: Academia | last post by:
(If you've seen this in the drawing NG, sorry. I inadvertently sent it there.) I have a listbox populated with Objects. The Class has a String field that ToString returns. I assume that is what the ListBox uses for its display. Correct?
1
8302
by: Refugnic | last post by:
I tried to fill a ListBox with a DataSource pointing to an ArrayList. It all works fine...up to one point. The ArrayList is dynamic, which means the contents of it change, during the course of program use. But instead of Updating the ListBox, virtually nothing happens. The items that were written into the ListBox during the first run remain...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.