problems on loading image button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ester

    #1

    problems on loading image button

    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
  • Cor Ligthert

    #2
    Re: problems on loading image button

    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.Attri butes("Style") = "Z-INDEX: 101; " & _
    "LEFT: 100px; POSITION: absolute; TOP: 300px"
    Dim mybutton As New Button
    mybutton.BackCo lor = Drawing.Color.W hite
    mybutton.Text = "Hello"
    mybutton.Width = New Unit(300)
    Me.Panel1.Contr ols.Add(mybutto n)
    ///
    I hope this helps?

    Cor





    "Ester" <anonymous@disc ussions.microso ft.com> schreef in bericht
    news:4FC8DABC-F46C-4ACD-9BC1-03C432C4CA59@mi crosoft.com...[color=blue]
    > I have an interior design of a living room with lights and aircond image.[/color]
    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.[color=blue]
    >
    > Thanks,
    > Ester[/color]


    Comment

    • Ester

      #3
      Re: problems on loading image button

      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

      Comment

      • Cor Ligthert

        #4
        Re: problems on loading image button

        Hi Ester,

        [color=blue]
        > First of all, thank you for your reply. Is the codes go to HTML or[/color]
        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
        [color=blue]
        > I got another question: As you mentioned that I have to drag and drop[/color]
        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("St yle") = "Z-INDEX: 101; " & _
        "LEFT: 100px; POSITION: absolute; TOP: 300px"
        Me.ImageButton2 .Attributes("St yle") = "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:ImageButto n id="ImageButton 2" runat="server"> </asp:ImageButton >
        <asp:ImageButto n id="ImageButton 1" runat="server"> </asp:ImageButton ></form>
        </body>[color=blue]
        >[/color]
        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.
        [color=blue]
        > As for the layout of the WebForm.aspx, it must be exactly the same as[/color]
        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.
        -----------------------[color=blue]
        > p/s: I wonder am I able to attach image file on the message so that it can[/color]
        better illustrate what I meant.

        No I think what you want to do.

        I hope this helps better?

        Cor


        Comment

        • Ester

          #5
          Re: problems on loading image button

          Hi Cor,

          Thank you so much for your time. I will try your method

          Thank
          Ester

          Comment

          Working...