Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VB 6 ODBC connection to SQL 2000 Pin
jimpar20-Apr-04 7:02
jimpar20-Apr-04 7:02 
GeneralRe: VB 6 ODBC connection to SQL 2000 Pin
JumpinJimmy20-Apr-04 10:01
JumpinJimmy20-Apr-04 10:01 
GeneralRe: VB 6 ODBC connection to SQL 2000 Pin
RichardGrimmer21-Apr-04 2:38
RichardGrimmer21-Apr-04 2:38 
QuestionDatabase connection error??? Pin
hounetdev20-Apr-04 5:07
hounetdev20-Apr-04 5:07 
QuestionHow do I autoupdate my application? Pin
ruseno20-Apr-04 4:08
ruseno20-Apr-04 4:08 
AnswerRe: How do I autoupdate my application? Pin
Michael Russell20-Apr-04 4:52
Michael Russell20-Apr-04 4:52 
GeneralStay inside MDI Client Area Pin
Michael Russell19-Apr-04 11:57
Michael Russell19-Apr-04 11:57 
GeneralRe: Stay inside MDI Client Area Pin
Dave Kreskowiak20-Apr-04 4:09
mveDave Kreskowiak20-Apr-04 4:09 
Graceful is in the eye of the beholder. If what you wrote works for you, great!

Another method, though, would be to put this kind of code entirely in the MDI Parent and when you create the new child form, you can get it's size and make sure that it is inside the MDI Parent's client window without iterating through all the controls...
' In MDI Parent
 
    Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
        Dim newChild As New frmChild
        newChild.MdiParent = Me

        ' You must show the form before it will receive its Top and Left values.  If you send
        ' the new form to EnsureChildInClientArea first, its Top and Left will always be 0,0.
        newChild.Show()
        EnsureChildInClientArea(newChild)
    End Sub
 
    Private Sub EnsureChildInClientArea(ByRef frmChild As Form)
        Dim r, b As Integer
        r = frmChild.Width + frmChild.Left
        b = frmChild.Height + frmChild.Top
        If r > Me.ClientSize.Width Or b > Me.ClientSize.Height Then
            frmChild.Top = 0
            frmChild.Left = 0
        End If
    End Sub


RageInTheMachine9532
GeneralRe: Stay inside MDI Client Area Pin
Michael Russell20-Apr-04 4:47
Michael Russell20-Apr-04 4:47 
GeneralRe: Stay inside MDI Client Area Pin
Dave Kreskowiak20-Apr-04 5:31
mveDave Kreskowiak20-Apr-04 5:31 
QuestionHow do I Pin
KORCARI19-Apr-04 10:08
KORCARI19-Apr-04 10:08 
AnswerRe: How do I Pin
Daniel Turini19-Apr-04 10:28
Daniel Turini19-Apr-04 10:28 
QuestionHow do I Pin
KORCARI19-Apr-04 10:06
KORCARI19-Apr-04 10:06 
AnswerRe: How do I Pin
Dave Kreskowiak20-Apr-04 3:49
mveDave Kreskowiak20-Apr-04 3:49 
QuestionHow do I Pin
Anonymous19-Apr-04 10:00
Anonymous19-Apr-04 10:00 
GeneralPackage and Deployment Wizard VB6 Pin
krekre19-Apr-04 6:46
krekre19-Apr-04 6:46 
GeneralRe: Package and Deployment Wizard VB6 Pin
Roger Wright19-Apr-04 7:17
professionalRoger Wright19-Apr-04 7:17 
GeneralRe: Package and Deployment Wizard VB6 Pin
krekre19-Apr-04 8:31
krekre19-Apr-04 8:31 
GeneralRe: Package and Deployment Wizard VB6 Pin
Mike Dimmick19-Apr-04 8:59
Mike Dimmick19-Apr-04 8:59 
GeneralRe: Package and Deployment Wizard VB6 Pin
krekre19-Apr-04 9:57
krekre19-Apr-04 9:57 
GeneralEmail in VB .NET Pin
Jubal1519-Apr-04 6:08
Jubal1519-Apr-04 6:08 
GeneralRe: Email in VB .NET Pin
Dave Kreskowiak19-Apr-04 9:40
mveDave Kreskowiak19-Apr-04 9:40 
GeneralRe: Email in VB .NET Pin
Jubal1519-Apr-04 19:39
Jubal1519-Apr-04 19:39 
Generalautoconverting word version Pin
dark_owl19-Apr-04 5:50
dark_owl19-Apr-04 5:50 
GeneralDistribution of VB.Net in the future Pin
trimtrom19-Apr-04 5:14
trimtrom19-Apr-04 5:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.