473,382 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Controls at run time

If I create several controls (images) at run time, how can I handle the click
event of this controls.

Thanks in advance,

Luis Mendes
Nov 21 '05 #1
4 2047
> If I create several controls (images) at run time, how can I handle the
click
event of this controls.


Use the AddHandler statement:

AddHandler TheObject.TheEvent, AddressOf TheProcedureToHandleEvent

HTH
Nov 21 '05 #2
Thanks for your sugestion.

I can deal with that if I know the number of images to create.

Let me explain better:

I wanto to scan a folder and present the images of that folder in panel (I
just know the number of images at run time).
When the user click's one of this images I need to know with was selected
in order to open a new form with this image.

Thanks in advance

Luis

"elziko" wrote:
If I create several controls (images) at run time, how can I handle the
click
event of this controls.


Use the AddHandler statement:

AddHandler TheObject.TheEvent, AddressOf TheProcedureToHandleEvent

HTH

Nov 21 '05 #3
> I wanto to scan a folder and present the images of that folder in panel (I
just know the number of images at run time).
When the user click's one of this images I need to know with was selected
in order to open a new form with this image.


It sounds like you want to show thumbnails of images and then allow the user
to click on a thumbnail to see a large image. Is that correct?

If it is then consider using a ListView.

At run time add your images to an ImageList and use that ImageList for the
LargeImageList property of the ListView. The you can add items to the
ListView during runtime setting each item's image index to be one of the
indexes in the image list.

Then you can use the SelectedIndexChanged event to see when a user has
clicked on a thumbnail.

HTH
Nov 21 '05 #4
Thanks.

"elziko" wrote:
I wanto to scan a folder and present the images of that folder in panel (I
just know the number of images at run time).
When the user click's one of this images I need to know with was selected
in order to open a new form with this image.


It sounds like you want to show thumbnails of images and then allow the user
to click on a thumbnail to see a large image. Is that correct?

If it is then consider using a ListView.

At run time add your images to an ImageList and use that ImageList for the
LargeImageList property of the ListView. The you can add items to the
ListView during runtime setting each item's image index to be one of the
indexes in the image list.

Then you can use the SelectedIndexChanged event to see when a user has
clicked on a thumbnail.

HTH

Nov 21 '05 #5

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

Similar topics

16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
2
by: Tim Marsden | last post by:
Hi, This is what I am doing, please comment if this is the correct way. I need to add controls to a form dynamically. Within the Page_Load event (is not Postback) I run a routine to create the...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
7
by: Varangian | last post by:
Hello is creating controls at runtime the same as designtime ? will a page be faster if controls are created at designtime rather than at runtime ? If so why ? thanks :)
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
4
by: Ken Fine | last post by:
I've been living with a frustrating issue with VS.NET for some months now and I need to figure out what the problem is. Hopefully someone has run into the same issue and can suggest a fix. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.