Link to home
Start Free TrialLog in
Avatar of RIAS
RIASFlag for United Kingdom of Great Britain and Northern Ireland

asked on

As soon as i click a button on the form,it mnimises.

Hwo can I prevent to minimise when I click a button on it.

Cheers
Avatar of it_saige
it_saige
Flag of United States of America image

A button?  Can you provide an example?

-saige-
Avatar of RIAS

ASKER

Its a runtime button created on the form.
As soon as i click on the form minmises.
The runtime button click event creates a runtime form
What is the code used for the runtime button click event?

-saige-
Avatar of RIAS

ASKER

  Private Sub LoadFrmInvoice(ByVal StrPosition As String)
        Dim StrGrossValue As String
        Dim dt As New DataTable
        StrGrossValue = TxtTotSpPayProactis.Text
        StrGrossValue = StrGrossValue.Replace(",", String.Empty)

        '************************New

        Dim GetRowFrorInvoice As New ClsSpPayProactis(Me.TxtInvNumberproc.Text,,,,, ,,, StrPosition,, ,,,,,, ,,,,,,,,
                                                 , ,,,,, , ObjMain_SpPayProactisID)

        dt = GetRowFrorInvoice.ClsSpPayProactis_FillDirectoryGrid(4, False)

        '**************************

        For Each dr As DataRow In dt.Rows
            'This is what I am doing now
            Dim AddrowinForm As New ClsSpPayProactis(dr.Item(dt.Columns("InvoiceNumber")),,,,, ,,, dr.Item(dt.Columns("Position")),, dr.Item(dt.Columns("TravelExpenseType")),,,,,, dr.Item(dt.Columns("GrossValue")),,,,,,,
                                               , dr.Item(dt.Columns("Description")), dr.Item(dt.Columns("Note")),,,,,, ObjMain_SpPayProactisID)
            Dim objFrm2 As New FrmInvoices(AddrowinForm, True)

            'Me.StartPosition = FormStartPosition.Manual

            'Me.Location = New Point(30,
            '30)  'Screen.GetWorkingArea(Me).Location
            Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width) \ 2, 0)

            With objFrm2
                .StartPosition = FormStartPosition.Manual
                'Select Case StrPosition
                'Case 1
                If IntLocationBase = 0 Then

                    .Location = New Point(Me.Left, Me.Bottom + objFrm2.Top)

                    IntLocationBase = Me.Bottom + objFrm2.Height

                Else
                    .Location = New Point(Me.Left, IntLocationBase + objFrm2.Top)
                    IntLocationBase += objFrm2.Height
                End If
                .WindowState = FormWindowState.Maximized
                .Show()
            End With
        Next
    End Sub

Open in new window

Nothing that you have shown so far would produce this effect, there must be something else in your code that is causing this.

-saige-
Avatar of RIAS

ASKER

When I create a runtime form , the previously created runtime form minmises

  Dim objFrm2 As New FrmInvoices(AddrowinForm, True) 

Open in new window

What is the code for your FrmInvoices?

-saige-
Avatar of RIAS

ASKER

It just passes the values from the class to it.
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RIAS

ASKER

Yes Sir, Will try to work it out with your guidance.

Thanks
Avatar of RIAS

ASKER

Cheers!