This is a migrated thread and some comments may be shown as answers.

Prevent double open form in tabbed document

7 Answers 46 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Hengky
Top achievements
Rank 1
Veteran
Hengky asked on 18 Apr 2017, 11:22 AM

Hello all

 

how to prevent double open form in tabbed document 

or how to cek if the form is opened, if opened so it will activated

 

thanks all 

7 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 18 Apr 2017, 11:27 AM
Hi Hengky,

The following article shows this: Docking Singleton Forms.

I hope this helps.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Hengky
Top achievements
Rank 1
Veteran
answered on 21 Apr 2017, 03:51 AM

Thanks Dimitar... 

if i use a form as Docking Singeton Forms. 

i can't call form_activated... how to make it happen ...

Thanks...

 

0
Dimitar
Telerik team
answered on 21 Apr 2017, 06:32 AM
Hello Hengky,

You can use the ActiveWindowChanged event. For example:
private void RadDock1_ActiveWindowChanged(object sender, DockWindowEventArgs e)
{
    if (e.DockWindow == null)
        return;
 
    if (e.DockWindow.Text == "Green Form")
    {
 
    }
    else if   (e.DockWindow.Text == "Yellow Form")
    {
 
    }
}

I hope this helps.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Hengky
Top achievements
Rank 1
Veteran
answered on 21 Apr 2017, 08:16 AM

Hello dimitar this what i mean

   Private Sub MstRekening_Activated(sender As Object, e As System.EventArgs) Handles Me.Activated

        Tampil()
    End Sub

procedure Tampil () doesn;t called... if i insert this form to document windows.. 

one more how to close document windows programmicatly

 

 

0
Hengky
Top achievements
Rank 1
Veteran
answered on 21 Apr 2017, 09:19 AM

Hello Dimitar..... 

    Private Sub MstRekening_Activated(sender As Object, e As System.EventArgs) Handles Me.Activated
        'Tampil()
        Using conn As New OleDbConnection(str)
            conn.Open()
            da = New OleDbDataAdapter("SELECT * from MstRekening ORDER BY KodeRekening", conn)
            ds = New DataSet
            ds.Clear()
            da.Fill(ds, "MstRekening")
            da.Dispose()
            GridList.DataSource = (ds.Tables("MstRekening"))
            GridList.BestFitColumns()
            conn.Close()
        End Using
    End Sub

this code is running well on form as usually ... but when i write this code on 

    Private Sub RadDock1_ActiveWindowChanged(sender As Object, e As Telerik.WinControls.UI.Docking.DockWindowEventArgs) Handles RadDock1.ActiveWindowChanged
        If e.DockWindow Is Nothing Then
            Return
        End If

        If e.DockWindow.Text = ".: Rekening :." Then
            Using conn As New OleDbConnection(str)
                conn.Open()
                da = New OleDbDataAdapter("SELECT * from MstRekening ORDER BY KodeRekening", conn)
                ds = New DataSet
                ds.Clear()
                da.Fill(ds, "MstRekening")
                da.Dispose()

                MstRekening.GridList.DataSource = (ds.Tables("MstRekening"))
                MstRekening.GridList.BestFitColumns()
                conn.Close()
            End Using
        End If
    End Sub

it doesn't work.... ? how make this code work ...

 

0
Dimitar
Telerik team
answered on 24 Apr 2017, 09:50 AM
Hi Hengky,

Thank you for writing.

I have attached a small project that shows how this works.

I hope this helps.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Hengky
Top achievements
Rank 1
Veteran
answered on 25 Apr 2017, 01:07 AM

Thanks a lot dimitar..

I will try it.

Tags
Dock
Asked by
Hengky
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Hengky
Top achievements
Rank 1
Veteran
Share this question
or