problems on loading image button

G

Guest

I have an interior design of a living room with lights and aircond image. My task is to load the living room image without any light and aircond images as background image of a WebForm after that I have to add image button which are lights and aircond images on top of this background image (living room). Instead of drag and drop an image button from the toolbox and browse the image link, I would like to load the image for the image button from database. In addition, I have to concern about the X- and Y-coordinates of those images on the interior design. For example, a light is located on the top-left corner of the living room on the interior design, I have to load the image on WebForm as it is on the design. My question is how to load the image button as I mentioned above. Can anyone please help me on this issue? I would appreciate your inputs

Thanks
Ester
 
C

Cor Ligthert

Hi Ester,

I think you can do it like this (I used a normal button in this sample
however that is not the problem).

(You have to drag a small panel on your form.)
I thought that the layout from the form is not important
\\\
Me.Panel1.Attributes("Style") = "Z-INDEX: 101; " & _
"LEFT: 100px; POSITION: absolute; TOP: 300px"
Dim mybutton As New Button
mybutton.BackColor = Drawing.Color.White
mybutton.Text = "Hello"
mybutton.Width = New Unit(300)
Me.Panel1.Controls.Add(mybutton)
///
I hope this helps?

Cor





Ester said:
I have an interior design of a living room with lights and aircond image.
My task is to load the living room image without any light and aircond
images as background image of a WebForm after that I have to add image
button which are lights and aircond images on top of this background image
(living room). Instead of drag and drop an image button from the toolbox
and browse the image link, I would like to load the image for the image
button from database. In addition, I have to concern about the X- and
Y-coordinates of those images on the interior design. For example, a light
is located on the top-left corner of the living room on the interior design,
I have to load the image on WebForm as it is on the design. My question is
how to load the image button as I mentioned above. Can anyone please help
me on this issue? I would appreciate your inputs.
 
G

Guest

Hi Cor

First of all, thank you for your reply. Is the codes go to HTML or WebForm.aspx Code Behind

I got another question: As you mentioned that I have to drag and drop panel from Toolbox but I should not do that in my case because I have to load the image for the image button from the database. In addition, it is not just an image button, the number of image buttons loaded to the WebForm.aspx vary on different interior designs. For example, number of devices (such as lights, airconds, etc), which are image buttons on the WebForm.aspx, on Xperson's house might be 10 whereas Yperson's house might be 20

As for the layout of the WebForm.aspx, it must be exactly the same as the interior design. For example, if a light located at top-left corner and the other located at bottom-right of the living room on the design then I have to load the light image buttons as they are into the WebForm.aspx

p/s: I wonder am I able to attach image file on the message so that it can better illustrate what I meant

Thanks
Ester
 
C

Cor Ligthert

Hi Ester,

First of all, thank you for your reply. Is the codes go to HTML or
WebForm.aspx Code >Behind?

I showed for use with an compiled application, so this will be code behind.
I now change my text now I know you are not using VS.net
I got another question: As you mentioned that I have to drag and drop
panel from Toolbox but I should not do that in my case because I have to
load the image for the image button from the database. In addition, it is
not just an image button, the number of image buttons loaded to the
WebForm.aspx vary on different interior designs. For example, number of
devices (such as lights, airconds, etc), which are image buttons on the
WebForm.aspx, on Xperson's house might be 10 whereas Yperson's house might
be 20.

That panel was needed to attach the button, that is how I normaly do however
in your case not needed. I tested it in this way.

Me.ImageButton1.Attributes("Style") = "Z-INDEX: 101; " & _
"LEFT: 100px; POSITION: absolute; TOP: 300px"
Me.ImageButton2.Attributes("Style") = "Z-INDEX: 102; " & _
"LEFT: 200px; POSITION: absolute; TOP: 100px"

However you need to put every button in the page, place is not important
the size you can also set in the style or with the properties from the
ImageButton as I showed in my previous message.

<body>
<form id="Form1" method="post" runat="server">
&nbsp;
<asp:ImageButton id="ImageButton2" runat="server"></asp:ImageButton>
You see that the buttons are now on an absolute place, that means that your
page should also not have dynamic posibilities, however only measurements
in pixels. Which mean that it on some screens can look terrible, I do not
know how it will be done in another way using ASPX.

However you never know and someone corrects me here.
As for the layout of the WebForm.aspx, it must be exactly the same as
the interior design. For example, if a light located at top-left corner and
the other located at bottom-right of the living room on the design then I
have to load the light image buttons as they are into the WebForm.aspx.
-----------------------
p/s: I wonder am I able to attach image file on the message so that it can
better illustrate what I meant.

No I think what you want to do.

I hope this helps better?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top