Solved

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

Posted on 2016-11-21
11
30 Views
Last Modified: 2016-11-23
Hwo can I prevent to minimise when I click a button on it.

Cheers
0
Comment
Question by:RIAS
  • 6
  • 5
11 Comments
 
LVL 33

Expert Comment

by:it_saige
ID: 41895928
A button?  Can you provide an example?

-saige-
0
 

Author Comment

by:RIAS
ID: 41895929
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
0
 
LVL 33

Expert Comment

by:it_saige
ID: 41895931
What is the code used for the runtime button click event?

-saige-
0
 

Author Comment

by:RIAS
ID: 41895933
  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

0
 
LVL 33

Expert Comment

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

-saige-
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:RIAS
ID: 41895991
When I create a runtime form , the previously created runtime form minmises

  Dim objFrm2 As New FrmInvoices(AddrowinForm, True) 

Open in new window

0
 
LVL 33

Expert Comment

by:it_saige
ID: 41895994
What is the code for your FrmInvoices?

-saige-
0
 

Author Comment

by:RIAS
ID: 41895996
It just passes the values from the class to it.
0
 
LVL 33

Accepted Solution

by:
it_saige earned 500 total points
ID: 41896000
What you are pointing to as a problem is not normal, it is not something that happens by default.  This is a case of something in your code that is causing the defect.  I cannot reproduce the issue based on the code that has been provided which means that you need to either create an example project (in the case where you are dealing with sensitive data) or provide more of your code.  I was asking for the FrmInvoices code (Designer and all).

-saige-
0
 

Author Comment

by:RIAS
ID: 41896004
Yes Sir, Will try to work it out with your guidance.

Thanks
0
 

Author Closing Comment

by:RIAS
ID: 41898935
Cheers!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Calling web service and its methods dynamically 2 42
Error on Add method 1 38
VB.Net How to Exit Sub - Exit Form??? 5 51
Help with AsEnumerable(), LINQ 4 22
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now