Quote:> I have a VB code that have a lot of forms in the project, I want to show
> severals(a lot) of forms inside one form, like outlook's stile. how can i
do
> that??? Thanks.
Outlook doesn't have forms within forms though. The individual panels justQuote:> I have a VB code that have a lot of forms in the project, I want to show
> severals(a lot) of forms inside one form, like outlook's stile. how can i
do
> that??? Thanks.
'*** START CUT ***'
Private Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Dim PanelVis(1) As Boolean
Const SmallSize = 315
Private Sub Form_Load()
Dim DoBtns As Integer
'Create an extra panels controls
Load Command1(1)
Load Picture1(1)
'Set up the panels
For DoBtns = 0 To 1
With Command1(DoBtns)
.Caption = "X"
.Move .Left, .Top, 255, 255
.Visible = True
SetParent .hWnd, Picture1(DoBtns).hWnd
Picture1(DoBtns).Visible = True
End With
Next DoBtns
'By default both panels are visible
PanelVis(0) = True: PanelVis(1) = True
End Sub
Private Sub Form_Resize()
'Redraw the panels
Call CheckPanels
End Sub
Private Sub Command1_Click(Index As Integer)
Dim ShowCap As String
'Reverse the visible state of this panel
PanelVis(Index) = Not PanelVis(Index)
'Get the button caption
If PanelVis(Index) Then ShowCap = "X" Else _
ShowCap = Chr(60 + ((1 - Index) * 2))
'Set the button caption
Command1(Index).Caption = ShowCap
'Stop the button caption being
' obscured by the focus rectangle
Picture1(Index).SetFocus
'Redraw panels
Call CheckPanels
End Sub
Sub CheckPanels()
'Work out where the panels need to go
If PanelVis(0) Then
If PanelVis(1) Then
'Both visible
Call MovePanels(Form1.ScaleWidth \ 2, _
Form1.ScaleWidth \ 2)
Else
'Just panel 1 visible
Call MovePanels(Form1.ScaleWidth - _
SmallSize, SmallSize)
End If
Else
If PanelVis(1) Then
'Just panel 2 visible
Call MovePanels(SmallSize, _
Form1.ScaleWidth - SmallSize)
Else
'Neither visible
Call MovePanels(SmallSize, SmallSize)
End If
End If
End Sub
Sub MovePanels(PanAWidth As Long, PanBWidth As Long)
With Picture1(0) 'Move panel 1
.Move 0, 0, PanAWidth, Form1.ScaleHeight
Command1(0).Move .ScaleWidth - 255, 0
End With
With Picture1(1) 'Move panel 2
.Move Form1.ScaleWidth - PanBWidth, 0, _
PanBWidth, Form1.ScaleHeight
Command1(1).Move .ScaleWidth - 255, 0
End With
End Sub
'*** END CUT ***'
Hope this helps,
Mike
-- EDais --
WWW: Http://Members.xoom.com/EDais/
Rejean Cloutier
Quote:> I have a VB code that have a lot of forms in the project, I want to show
> severals(a lot) of forms inside one form, like outlook's stile. how can i
do
> that??? Thanks.
Quote:> I have a VB code that have a lot of forms in the project, I want to show
> severals(a lot) of forms inside one form, like outlook's stile. how can i
do
> that??? Thanks.
Or, use the Win32 API to display the forms inside ALIGNed picture boxes (IQuote:> I would use frames instead of forms.
Phillip
Hi there,
I have sucessfully followed the many examples on doing opengl in borland
c++ builder, but I was hoping to get it to show inside a form (so I can
have form elements around it etc) instead of opening a new window. Can
I do it without having to use a full-featured opengl component?
I thought it might be just related to changing the type of device
context I'm using, but I'm not sure what to point it to.
Thanks,
Phil
3. questions on GL,Inventor,OpenGl and forms and Forms Bug
4. Plugin help files and fonts not loading!!
6. Need great skies&backdrops, downloadable now?
9. How do I get the size of form borders and title bar on a form
10. Embedding a form in another form
11. Copy a contro from one form to another Form
12. Special form-to-form transitions...possible?
13. MDI Form, ZOrder of Componets vrs MDIchild forms