Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey guys...

 

I am working on a new project with the tab control object and an axwebbrowser object...

 

One thing I want to allow the user to do is to change the positioning of the tabs on the tab control ( top, right, bottom, left ) at run time...

 

I have tabcontrol1 with tabpage1 and AxWebBrowser1 is on tabpage1...

 

When the program starts, it comes up fine, but when I change the tab alignment property on the tabcontrol1 object ( at run time ) then the tab will move to the desired place...

 

The problem is that when the tabs omve, the axwebbrowser object disappears and I cant get it back...

 

I've tried:

tabpage1.sendtoback()

axwebbrowser1.bringtofront()

 

Any ideas??

UCM

>-)

Posted
I don't understand why but if you set its Visible property to True it will be displayed again. Why it's being hidden is anyones guess!

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted

Yes the webbrowser control is set to fill....and I haven't tried other controls yet...

 

When I get back home, i'm going to try the ideas you've all had...

 

Its so weird though, any idea why it does that?

UCM

>-)

  • *Experts*
Posted

You piqued my curiosity... and, true enough, when changing tab alingment in code only the WebBrowser seems to disappear. You can fix it by setting the Visible property to true after you change the tab's Alignment. Other controls, such as a checkbox, seemed to work just fine after the alignment switch. Go figure :)

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Just an update...

 

I used the following code to see what happens ( a little ):

   Me.TabControl1.Alignment = TabAlignment.Left
   Me.Text = Me.AxWebBrowser1.Visible.ToString

This code proved that once the tabalignment is changed then the AxWebBrowser object is automatically made invisible...

 

It's probably a minor defect that Microsoft overlooked

 

Of course, just like all of you said, setting the visible property to True after changing the tabalignment corrects the issue...

 

Hope MS gets dat fixed in the next .net framework release...

UCM

>-)

Posted

Anyone know a 3rd party tabcontrol???

 

U know...This is definately NOT cool :-/

 

It does it not only at run time but in the designer as well...

 

As near as I can figure, the tabcontrol will make it's panel object ( the one that microsoft put in the control along with the tabstrip control ) the top most object over axtive x controls like the axwebbrowser...

 

Setting many many lines of code in all the right areas to make the axwebbrowser object 'visible' at run time isn't very plausable, Especially since it's whenever you change anything in the tabcontrol ( like adding a tab for instance :-/ )

 

It's totally screwy... If all else fails, I will just have to break down and create my own tabcontrol from scratch ( talk about work, oyy )

UCM

>-)

  • *Experts*
Posted

I'm not sure how feasable this is, but try something like this:

Add a new property to your form called MyTabControl that returns an instance of the private TabControl. In the get property, set the webbrowser control's Visible = true. Then in code, replace all of YOUR lines from tabControl1 to MyTabControl. By "your" lines I mean don't change the "windows designer generated code" - mostly everything in the InitializeComponent function.

 

Untested, but something like this should work.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Right on!

 

Brilliant idea! and so far so good, Thanx to you Nerseus :D

 

 

I used this code:

 
 Private MyTabPageData As TabPage
 Private Property MyTabPage() As TabPage
   Get
     Return MyTabPageData
     Me.AxWebBrowser1.Visible = True
   End Get
   Set(ByVal Value As TabPage)
     MyTabPageData = Value
     Me.AxWebBrowser1.Visible = True
   End Set
 End Property

 Private Sub Form1_Load(Blahhhh) Handles MyBase.Load

   Me.MyTabPage = New TabPage()
   Me.TabControl1.TabPages.Add(Me.MyTabPage)

 End Sub


 

It seems to be working now ==)

 

I'm going to test it a little more and post my results...

 

Thanx again!!!

UCM

>-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...