I can't activation MDIform from other form

dodo_mt

New member
Joined
Mar 14, 2008
Messages
2
Programming Experience
Beginner
Hi I am new here and my English is ....:)

I create word processor whit MDI Container...

I have create maniform > MDI container and mdiForm like mdiWindow
I have create in mainForm menustrip. When i click on menu my program open form3. There are textbox's and button. When I click on button I want copy my text in textbox to my mdiForm to my richetextbox...

My problem:

I can't activate mdiForm from Form3 or other Form's

Here is my code:

This is code when I click on OK button

VB.NET:
 Dim Doc As mdi

        If Not IsNothing(Me.ActiveMdiChild) Then

            If ChB1.Checked = True Then
                Doc = Me.ActiveMdiChild

                Doc.rtb1.Text = Doc.rtb1.Text & "CYCL DEF 200 VRTAT ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q200=" & Me.tb1.Text & "          ; BEZPEC. VZDIALENOST ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q201=" & Me.tb2.Text & "          ; HLBKA ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q206=" & Me.tb3.Text & "          ; POSUV PRISUVU DO HL. ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q202=" & Me.tb4.Text & "          ; HLBKA PRISUVU ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q210=" & Me.tb5.Text & "          ; CAS. VYDRZ HORE ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q203=" & Me.tb6.Text & "          ; SURADNICE POVRCHU ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q204=" & Me.tb7.Text & "          ; 2. BEZPEC. VZDIALENOST ~"
                Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & "Q211=" & Me.tb8.Text & "          ; CAS. VYDRZ DOLE ~"

            Else
                ChB2.Checked = True
                Doc = Me.ActiveMdiChild

                Doc.rtb1.Text = Doc.rtb1.Text & "G200 " & "Q200=" & Me.tb1.Text & "Q201=" & Me.tb2.Text & "Q206=" & Me.tb3.Text _
                & "Q202=" & Me.tb4.Text & "Q210=" & Me.tb5.Text & "Q203=" & Me.tb5.Text & "Q204=" & Me.tb5.Text

            End If

        End If

        Close()

When I have only form1 whit richtextbox and form2 whit textbox and I push button everything is be OK.

Thanks


Dodo
 
HI

I found my problem today... It was very easy..

VB.NET:
Dim Doc As mdiForm
        ' Aktivuje MDI okno
        If Not IsNothing(mainForm.ActiveMdiChild) Then
            Doc = mainForm.ActiveMdiChild

            ' Kapsa Arrow vyskusana funguje
            Doc.rtb1.Text = Doc.rtb1.Text & "(MSG,""" & Me.tb_pozn.Text & """)"
            Doc.rtb1.Text = Doc.rtb1.Text & vbCrLf & ":T" & Me.tb_nastroj.Text & "M6"

        End If

        Me.Close()

Bye thanks

dodo
 
Back
Top