Post by btechuk on May 12, 2015 8:01:56 GMT 10
I am currently in the process of making a Web Browser to be used in my OS/User Interface, because my current one is long-due for a face lift and performance enhancements. However, I'm looking to create an 'Add Tab' button as seen in Lumia Browser and others such as Chrome and Firefox. The closest I have gotten is inserting a buttonitem that creates a new tab and inserts a browser control but there a 2 problems: -Using .CreateTab("tab name") inserts the tab on the far-right of the control ( Here) -Creating a new DevComponents.DotNetBar.SuperTabItem, using .AttachedControls.Controls.Add(b) --b being browser-- and then using SuperTabControl1.Tabs.Add(tp) just creates an "object reference not set to an instance of an object" error during debug. Any help would be greatly appreciated!
|
|
Post by dar on May 13, 2015 2:54:00 GMT 10
Hope this helps. I took this from my own (unreleased browser module - "Magna:Browse"
Dim newTab As SuperTabItem = SuperTabControl1.CreateTab("Blank", SuperTabControl1.Tabs.Count - 1) Dim panel As SuperTabControlPanel = DirectCast(newTab.AttachedControl, SuperTabControlPanel) SuperTabControl1.SelectedTabIndex = SuperTabControl1.Tabs.Count - 2
If you have any problems. Tell me :-p
|
|
Post by btechuk on May 13, 2015 4:38:39 GMT 10
Thank you!
|
|
Post by Nathan Lecompte on May 16, 2015 12:01:19 GMT 10
btechuk If your question has been answered please click the "Accept" button next to the post which answered your question
|
|
Post by btechuk on May 16, 2015 22:55:07 GMT 10
It works brilliantly! 1 final question though, how would I go about adding a browser control to it? (An IE control for testing purposes at the moment)
|
|
Post by Imformas on May 17, 2015 3:40:06 GMT 10
I'm not good with DevDotNet Components but i assume you add a control like CType(newTab.AttachedControl, SuperTabControlPanel).Controls.Add(yourControl)
Correct me if im wrong nathan!
Programming language'sCSharpC++CObjective-CVBProject'sSharpMediaSharpEditYoutifygithub.com/Stephen-Fox-0
|
|
Post by dar on May 21, 2015 22:42:36 GMT 10
Hmmm. Informas coder is right...
here is complete code:
Dim newTab As SuperTabItem = SuperTabControl1.CreateTab("Blank", SuperTabControl1.Tabs.Count - 1) Dim panel As SuperTabControlPanel = DirectCast(newTab.AttachedControl, SuperTabControlPanel) panel.Controls.Add(yourControl) SuperTabControl1.SelectedTabIndex = SuperTabControl1.Tabs.Count - 2
|
|