Can't control the behavior of MDI forms

mikechan8888
08-16-2006, 04:12 AM
I am trying to develop an MDI application but face a couple problems controlling the appearance of the application.

I've circled 2 problems in the picture:

1) When I open the MDI child, the page scroll down to the bottom but I want it to scroll to the top.
2) I can't hide the control bar by setting the ControlBox property to False. This can be done in VB6.

Below please find the code of my application.

Thanks.


Protected Const ptvDataBB = 0
Protected Const ptvReport = 1
Protected Const ptvExit = 2


Private Sub openForm(ByRef frm As Form)
With frm
.MdiParent = Me
.Show()
.WindowState = FormWindowState.Minimized
.WindowState = FormWindowState.Maximized
End With
End Sub


Private Sub tbMain_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles tbMain.ButtonClick
Select Case e.Button.ImageIndex
Case ptvDataBB
Dim frmDB As New frmDataBB

If TypeOf (ActiveMdiChild) Is frmDataBB Then
frmDB.Focus()
Else
openForm(frmDB)
End If
Case ptvReport
Dim frmRpt As New frmReportViewer

frmRpt.ShowDialog()
Case ptvExit
If Me.ActiveMdiChild Is Nothing Then
Me.Close()
Else
Me.ActiveMdiChild.Close()
End If
End Select
End Sub

mikechan8888
08-17-2006, 02:01 AM
Does anyone have any idea to resolve my problems? Did I describe the problems clearly?

Thanks in advance!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum