473,396 Members | 1,785 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,396 software developers and data experts.

When you add an Image programmatically...

Hi all,

I want to add an Image programmatically, but it needs to be a hyperlink - so
do I add a Hyperlink object and then set its 'text' to be the "<img src="
etc or do I add a hyperlink and add a control to that which is the image??

Any info appreciated,

Regards

Rob
Nov 18 '05 #1
3 2084
"Ryan Riddell" wrote ...
Dim hl As New HyperLink()
hl.ImageUrl = "http://www.google.com/images/logo.gif"
hl.NavigateUrl = "http://www.google.com"
Holder.Controls.Add(hl)


Hi Ryan,

Many thanks for that - typical isn't it - I just tried it the way I
suggested and it works fine - now I see your code which is a good few lines
less - always the way :)

I think I'll adopt your approach as its less code - easier to refer back to
later.

Reg's

Rob
Nov 18 '05 #2
Ooow - just one thought though - can you also set the images width, height
and border settigns??
Nov 18 '05 #3
"Ryan Riddell" wrote ...
I don't believe you can with the ImageUrl method. If you want to you will
most likely need to do what you initially said. That is, set the text to be '<img height="..." width="..." src="...">'


Or do a new Image object and then add that object via the controls.add
etc...thats what I've got at the mo - seems to be ok and gives the extra
functionality ..

Cheers for that earlier snippet though - I've added that to my little code
respository to use where I dont need to be so specific with the images
attributes :o)

Reg's

Rob
Nov 18 '05 #4

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

Similar topics

2
by: DanS | last post by:
Does anyone know how to change an image from color to black and white / greyscale programmatically in c#? Nothing in the image or bitmap objects looked promising? thanks!
4
by: murrayatuptowngallery | last post by:
I have looked at some mouseover/ sound object scripts and can't get them to work. Most were more complex than needed and introduced several new parameters for me. I found a simple pair of html...
2
by: sandman | last post by:
Is this a one-time deal? Or something you want to do programmatically? If it's a one-time thing (e.g. to create a bitmap that you can then use in your program), just press Print-Screen, then load...
3
by: Kristof Thys | last post by:
Hello, I'm writing a ASP.net webservice wich will visualize an image, generated by another application. The generated image is a char*. I can transform this to a String*, but I want to view it...
2
by: UJ | last post by:
I have need to convert a text string (with formatting) to an image. This is so that I can resize the image to different sizes and the formatting stays exactly the same regardless of the size. I...
2
by: dineshbajaj | last post by:
Hi Everybody, I need to split an image file(*.jpeg) programmatically to nine or more equal parts. Since, the code is meant to run on Windows Pocket PC 2002, I can only use methods supported...
1
by: Rico | last post by:
Hello, I have an ole object field (Access XP/2002) which I store images in. I have a couple of questions regarding this; is it possible to determine the image dimensions? Secondly, is there...
0
by: ANGanley | last post by:
Can anyone help me this? I have a class. Public Class db_Vehicle Public bs_VehicleDetails As New BindingSource() Public da_VehicleDetails As New SqlDataAdapter() Public table...
8
by: =?Utf-8?B?UGF1bCBT?= | last post by:
Hi How can I programmatically save an image from a page locally? The same as right-click the image and select 'Save as' Tanks Paul S
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.