locked
How to display a button of WIDTH=100% in a WebBrowserControl? RRS feed

  • Question

  • The following HTML displayed in a WebBrowserControl on Windows Mobile (6.0, 6.5, using CF 2.0 or 3.5) shows two buttons of the same size.

    How can I get the WebBrowserControl to display a button on 100% of the screen?

    My code simply uses webControl.Navigate("local_file.htm"); to load the HTML below.

    <html>
       <div>
         <input type="button" value="Button 75%" style="WIDTH:75%" />
         <input type="button" value="Button 100%" style="WIDTH:100%" />
       </div>
    </html>
    • Edited by mihaelaa Wednesday, October 28, 2009 8:40 PM cleanup spaces
    Wednesday, October 28, 2009 8:38 PM

Answers

  • Generally this forum deals with deskop applications. I would recommend you go to http://forums.asp.net/48.aspx for quesions about mobile web development. You'll have a better audience there.
    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    • Marked as answer by warrentang Wednesday, November 4, 2009 5:24 AM
    Monday, November 2, 2009 7:09 AM

All replies

  • It stricly depends on the css that is implemented in particular WM versions.
    You may be able to do it only by px (absolute) values. Relative (%) values may not work.

    Besides that, where's Your <body> tag ?

    If You'll find my answer satisfactory or helpful - mark it as answered or vote for it! Thank You.
    "If You think You know better then me, why is Your code not working, then don't waste my time at this forum. Otherwise - do as I'm suggesting."
    Thursday, October 29, 2009 8:31 AM
  • I tried px and the buttons still don't grow past 75% of the size of the WebBrowser. Same for text boxes.
    If I use WIDTH=100% for image or select, these are sized correctly.
    Thursday, October 29, 2009 6:53 PM
  • Tried same but without that <div> tag?
    If You'll find my answer satisfactory or helpful - mark it as answered or vote for it! Thank You.
    "If You think You know better then me, why is Your code not working, then don't waste my time at this forum. Otherwise - do as I'm suggesting."
    Thursday, October 29, 2009 7:45 PM
  • Yes, <div> or no <div> doesn't make a difference.

    html>
      <head>
        <title>Untitled Page</title>
      </head>

      <body bgcolor="#001155" >
        <!--Wraps around at about 75%-->
        <button type="button">Button with long label a b c d e f g h i j k l m</button>
       
        <!--Sizes to about 75% -->
        <input type="button" value="Button 100%" style="WIDTH:100%; position:center "/>
          
        <!--Sizes correctly to 100%-->
        <select style="width:100%">
           <option value="Select 100%">Dropdown 100%</option>
        </select> 
     
        <!--Sizes correctly to 100%-->
        <img src="file:\\My Documents\\My Pictures\\Grass.jpg" alt="Image 100%" style="width:100%"/>
       
        <!--Sizes to about 75% -->
        <input type="text" value="Text 100%" style="WIDTH:100%"/>
       
      </body>
    </html>

    • Edited by mihaelaa Thursday, October 29, 2009 9:19 PM try again to format the pasted html
    Thursday, October 29, 2009 9:10 PM
  • And without doing it in style? Like <input type="button" value="test" width=100% /> .
    If You'll find my answer satisfactory or helpful - mark it as answered or vote for it! Thank You.
    "If You think You know better then me, why is Your code not working, then don't waste my time at this forum. Otherwise - do as I'm suggesting."
    Friday, October 30, 2009 7:15 AM
  • That way width ignored.

    I narrowed down my problem at least. It happens on Pocket IE (I mistakenly thought it was only the WebBrowserControl) and not on IE6.

    Whatever combination I tried (in and out of tables, setting the width of the body), nothing makes a difference.

    I wonder if this is a limitation of Pocket IE. But if that's true, how come I can't find any comments about it on the web? I'm testing now on WM6 Professional Emulator (CE OS 5.2.1235).
    Friday, October 30, 2009 4:40 PM
  • Generally this forum deals with deskop applications. I would recommend you go to http://forums.asp.net/48.aspx for quesions about mobile web development. You'll have a better audience there.
    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    • Marked as answer by warrentang Wednesday, November 4, 2009 5:24 AM
    Monday, November 2, 2009 7:09 AM