UCM Posted January 23, 2003 Posted January 23, 2003 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?? Quote UCM >-)
TechnoTone Posted January 23, 2003 Posted January 23, 2003 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! Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Gurus* divil Posted January 23, 2003 *Gurus* Posted January 23, 2003 Does the WebBrowser control have its Dock property set to Fill? Does it work with other controls embedded, i.e. a textbox or something? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
UCM Posted January 23, 2003 Author Posted January 23, 2003 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? Quote UCM >-)
*Experts* Nerseus Posted January 23, 2003 *Experts* Posted January 23, 2003 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 Quote "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
UCM Posted January 23, 2003 Author Posted January 23, 2003 Thanx everyone... Thanx Nerseus, and everyone...When I get home, I'll get it up and runn'n :D Quote UCM >-)
UCM Posted January 24, 2003 Author Posted January 24, 2003 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... Quote UCM >-)
UCM Posted January 25, 2003 Author Posted January 25, 2003 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 ) Quote UCM >-)
*Experts* Nerseus Posted January 25, 2003 *Experts* Posted January 25, 2003 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 Quote "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
UCM Posted January 26, 2003 Author Posted January 26, 2003 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!!! Quote UCM >-)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.