What is the best way to add textboxes to a drawing in

Posted on 2011-10-21
Last Modified: 2012-08-13
I am developing an application that takes power readings from a database and displays them. What I want is to super impose the readings on to a mimic drawing.
see attached example, Power mimic example,  the readings are the power readings. I thought of creating a table and inserting pictures and textboxes in to cells to make up the page, this is alot of work. If any develpers can help with a better solution here are some points.
Question by:dearness
    LVL 20

    Accepted Solution

    If I understand what you are trying to do correctly the first idea that comes to my mind is to lay the image as a background and use CSS to position your textboxes as you'd like. It's a little work, certainly less work than tables (tables are for tabular data not layout...just had to say that).

    So I'd do something like this(just to get you started):
    <see code><see screen shot> Power Textbox overlay SS
        <form id="form1" runat="server">
        <div style="background-image:url('img/Power-Asp.jpg'); height:298px; width:534px; position:relative;">
    	<asp:TextBox ID="TxtPwr1" runat="server" style="position:absolute; top:62px; left: 84px; width:58px; " />

    Open in new window


    Author Comment

    Thanks for the pronpt reply, exactly what I want. I am obviously new to this. Now to get brush up on CSS. Thanks.
    LVL 20

    Expert Comment

    The only trick to this is the position relative/absolute.

    1. There is an outer container, in this case a <div>. This container has the background-image and its dimensions are set to the same height/width as that image. This container has position relative. What this means is that any absolutely positioned elements inside of it will calculate their left/right/top/bottom position from this parent rather than the entire <html> element.

    2. You make textboxes inside the <div>, set them absolute, set their left/top dimensions and adjust till you get where you want. In general this is what is happening. I also set the size of the textbox but I'm hoping it will be pretty simple for you to follow.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now