Workspace tabs

Post

Posted
Rating:
#1 (In Topic #1448)
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’
gbWilly leads the usergroup ‘GambOS Contributor’
gbWilly is in the usergroup ‘Blogger’
On below image you see a form with a TabPanel (on the left) and one with Workspace (on the right).
As you can see on opening the TabPanel form, the first tab is selected and shown on top.
When opening the Workspace form, the last tab is selected and shown on top.

Attachment

My problem:
On the Workspace form I want the first tab (Form One) as first tab and also as selected and on top (just like with the TabPanel).
I have been wrestling with this now for several days, but can't figure out how to select Form One tab on opening, other than adding Form One as last to the Workspace, but then the tab order is wrong.

Code for Workspace form is as follows:

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.   Dim hForm1 As FOne
  4.   Dim hForm2 As FTwo
  5.  
  6.   hForm1 = New FOne("Form One")
  7.   hForm2 = New FTwo("Form Two")
  8.  
  9.   Workspace1.Add(hForm1)
  10.   Workspace1.Add(hForm2)
  11.  
  12.  

I added the source archive with application in above screenshot.

gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
Just use

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.   Dim hForm1 As FOne
  4.   Dim hForm2 As FTwo
  5.  
  6.   hForm1 = New FOne("Form One")
  7.   hForm2 = New FTwo("Form Two")
  8.  
  9.   Workspace1.Add(hForm1)
  10.   Workspace1.Add(hForm2)
  11.  
  12.   Workspace1.ActiveWindow = hForm1
  13.  

Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’
gbWilly leads the usergroup ‘GambOS Contributor’
gbWilly is in the usergroup ‘Blogger’

thatbruce said

Just use

  Workspace1.ActiveWindow = hForm1

I knew it would be something easy, been fiddling on and off, trying, reading wiki, trying…  :D
I was thinking to complex, more along the lines of below, but then to activate the tab instead of make it disappear.

Code (gambas)

  1.   Workspace1.TabPanel[0].Visible = False

Never even thought about ActiveWindow although it passed a 1000 times…

Thanks Bruce

gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top
1 guest and 0 members have just viewed this.