Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS WebBrowser on a Form: resize problem.

Status
Not open for further replies.

eVAPor8

IS-IT--Management
Jul 4, 2009
18
GB
Hi chaps and chapesses!

Ok, I've a "weird one" for you.

I've place a WebBrowser Conrol on a form taking up about 75% of the form (buttons/txtBoxes to the left and top)

All is cool so far, and a have a nice box above the Browser for cosmetics and intuity. Now here's the problem... Check out the following code - BoxHeader is our header box and axBrowser is our WebBrowser Control:

Code:
Private Sub Form_Resize()
    BoxHeader.Width = (InsideWidth - BoxHeader.Left) - 200
    axBrowser.Width = BoxHeader.Width
    axBrowser.Object.Height = (Detail.Height - axBrowser.Top) ' <---yes i know that's wrong!
End Sub

OK, all looks fine so far..

So. Open the form Restored and resize it as normal. (Here's where the fun begins). The BoxHeader resizes as expected, however, our WebBrowser get wider and wider with every resize event. Step the code and Watch the Width property. Even try to Assert it manually like axBrowser.Width = 2000.

The Browser control basically stick two fingers up and just add about 200 twips to width every time. Now i suspect this behaviour is something to do with it's relationship (no pun intended!) with IE since Access can't seem to set methods like ToolBar, MenuBar and AddressBar.

Now I'm working on a "Locked down" (read "almost unusable) network, so it might be just the local systems misbehaving or (more probably) something Microsoft has (un?)documented to their usual high standards for VB'ers.

Can anyone else reproduce this behaviour?

More importantly, can anyone say "Don't set the Width property at all! It's actually the whatever property you need to drill down to in this case!
 
EDIT: it's Access 2003 running on XP SP2.

I used to be the Comaboy on Tek-Tips.

...And the despicable Jeremy Vyle elsewhere. ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top