Prevent double open form in tabbed document

8 posts, 0 answers
  1. Hengky
    Hengky avatar
    26 posts
    Member since:
    Sep 2015

    Posted 18 Apr Link to this post

    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 

  2. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 18 Apr Link to this post

    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.
  3. Hengky
    Hengky avatar
    26 posts
    Member since:
    Sep 2015

    Posted 20 Apr Link to this post

    Thanks Dimitar... 

    if i use a form as Docking Singeton Forms. 

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

    Thanks...

     

  4. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 21 Apr Link to this post

    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.
  5. Hengky
    Hengky avatar
    26 posts
    Member since:
    Sep 2015

    Posted 21 Apr in reply to Dimitar Link to this post

    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

     

     

  6. Hengky
    Hengky avatar
    26 posts
    Member since:
    Sep 2015

    Posted 21 Apr in reply to Hengky Link to this post

    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 ...

     

  7. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 24 Apr Link to this post

    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.
  8. Hengky
    Hengky avatar
    26 posts
    Member since:
    Sep 2015

    Posted 24 Apr in reply to Dimitar Link to this post

    Thanks a lot dimitar..

    I will try it.

Back to Top