Problem with layout - Rendering and docked elements

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 9250 Views - Last Post: 28 December 2011 - 01:42 PM Rate Topic: -----

#1 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 11:29 AM

Hi. I'm having a few problems with the layout of my new browser. I have a WebBrowser control which is docked 'Fill', and a MenuBar at the top docked 'Top'. When I run the program and go to Google (which has a dark bar at the top), a white gap becomes visible. I think that this is because the MenuBar's RenderMode is set to 'System'. When I click on it in the editor the bottom of the background is a few pixels away from the MenuBar's bounding square.

This is what I mean: (the red box shows what I mean)
Posted Image

Also, the MenuBar's RenderMode has to be set to System other wise the control is drawn as a rounded-rectangle and there are gaps in the background image in the corners. That said, I could change it, if someone could provide a solution to showing the background image in another control and set the MenuBar's background to transparent.

This post has been edited by ToshNeox: 23 December 2011 - 11:31 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Problem with layout - Rendering and docked elements

#2 ricardosms  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 74
  • View blog
  • Posts: 301
  • Joined: 02-April 10

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 12:23 PM

What did you created before, the menu bar or the webbrowser?
When you dock fill the control takes all available space, so you should dock first your menu bar, then the webbrowser or in due case you could dock right and bottom, and set manually top and left. The other thing that comes to mind is borderstyle.
Was This Post Helpful? 0
  • +
  • -

#3 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 12:51 PM

Okay so basically the menubar is docked at the top and then the webbrowser is docked with fill. What is happening is that because I set the menubar's renderstyle to System, it creates a small gap below the control. Then when there is a dark block at the top of the webbrowser, it shows up... I'll add a picture in a minute.
Was This Post Helpful? 0
  • +
  • -

#4 DimitriV  Icon User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 12:59 PM

I think that it's the top of the WebBrowser control but I am not sure. Need a bit more detail to determine this.
Was This Post Helpful? 0
  • +
  • -

#5 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 01:10 PM

Look at the gap below the menu bar:
Posted Image

This post has been edited by ToshNeox: 23 December 2011 - 01:11 PM

Was This Post Helpful? 0
  • +
  • -

#6 DimitriV  Icon User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 01:17 PM

View PostToshNeox, on 24 December 2011 - 06:10 AM, said:

Look at the gap below the menu bar:
Posted Image

Try to send the web browser to the back.

I think the MenuStrip is slightly too tall.
The grey dotted line outlining the selected menustrip goes into the space of the WebBrowser control by a couple of pixels, maybe make its height smaller.
But still, I am not totally sure about this.
Was This Post Helpful? 0
  • +
  • -

#7 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 01:33 PM

Okay I sent it to the back but the browser then docks to the size of the whole form. Also, I don't understand what you mean about the height of the menu strip. The dotted line is the bottom of the control, and it is not going over the webbrowser. The problem is that the renderstyle creates a small gap at the bottom of the menubar. I can't make the menubar higher to redude the gap because the webbrowser just gets smaller.
Was This Post Helpful? 0
  • +
  • -

#8 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 02:15 PM

Check the values in the padding of each control. I think by default it is (4,4,4,4)
Was This Post Helpful? 0
  • +
  • -

#9 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 02:48 PM

I've reset them but it's still the same issue.
Was This Post Helpful? 0
  • +
  • -

#10 ricardosms  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 74
  • View blog
  • Posts: 301
  • Joined: 02-April 10

Re: Problem with layout - Rendering and docked elements

Posted 23 December 2011 - 08:00 PM

your picture shows something on the left on what you call a gap. I think you have your menu on top of the webbrowser. Try what I suggested. Cut your browser and paste it again, so it will have a higher tab order.
Was This Post Helpful? 0
  • +
  • -

#11 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Problem with layout - Rendering and docked elements

Posted 24 December 2011 - 02:19 AM

Okay, I won't be able to change anything for a while today, but as explained in the editor picture, that gap is part of the menubar and cannot be removed.
Was This Post Helpful? 0
  • +
  • -

#12 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Problem with layout - Rendering and docked elements

Posted 26 December 2011 - 12:04 PM

No, the gap is still there.
Was This Post Helpful? 0
  • +
  • -

#13 ricardosms  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 74
  • View blog
  • Posts: 301
  • Joined: 02-April 10

Re: Problem with layout - Rendering and docked elements

Posted 26 December 2011 - 12:42 PM

Maybe you could set yor controls like this:
menu strip docket at top, webbrowser docked at bottom and
webbrowser.top ₌  menustrip.top + menustrip.height - 2



to overlap 2 pixels

Set the tab order to have the last one on top of the other
Was This Post Helpful? 1
  • +
  • -

#14 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Problem with layout - Rendering and docked elements

Posted 28 December 2011 - 10:58 AM

Hi, thanks, it works now. I used the following:
Browser_WebBrowser.Height = Me.Height - 80

Was This Post Helpful? 0
  • +
  • -

#15 ricardosms  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 74
  • View blog
  • Posts: 301
  • Joined: 02-April 10

Re: Problem with layout - Rendering and docked elements

Posted 28 December 2011 - 12:58 PM

That is good. But I would do a couple of tests with resizing and screen resolution, just to be on the safe side.
Cheers!
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2