none
Resolution Issue?

    Question

  • Hi guys. 

    First of all I want to thank everyone who has helped me out so far. You are all really helping me become the person I want to be. 
    Without places like this I would be lost. 

    Anyway. I have been developing a tenant database for a landlord. He is running windows XP and I managed to go see him today and install it on his computer. Everything worked fine (which I was happy about as it was my first time lol). 

    My issue however, is that my application is half way off the monitor screen. 

    Could someone please point me in the right direction on how to fix this. Its my only issue and after this I can sell my product to him. 

    Once again I am really grateful for each and every one of you for helping me. 
    Wednesday, April 19, 2017 1:26 PM

All replies

  • Without code or language, it is difficult to see the problem.

    But maybe you can see : Writing DPI-Aware Desktop and Win32 Applications

    Wednesday, April 19, 2017 1:47 PM
  • Hi Castorix31,

    Please forgive me for not being more specific. I will get better at this. lol

    I started a windows forms application in VB. Here is the code for my main form which is also the form that is being cut off on the monitor. 

    I have not added any code that controls size or scale. I just made the form appear in center. Other that that I have not attempted anything as I am not sure yet as what to do. 

    So is there any reason why I have caused this to happen. 

    I tested in a virtual box first and all was well. 

    Thanks for the link, I will read through it carefully. Any further help would be fantastic. 

    I appreciate you taking the time to help me. 

    Public Class Form3
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'TODO: This line of code loads data into the 'TenantDatabase1DataSet.TenantTable' table. You can move, or remove it, as needed.
            Me.TenantTableTableAdapter.Fill(Me.TenantDatabase1DataSet.TenantTable)
    
        End Sub
    
        Private Sub TenantTableDataGridView_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles TenantTableDataGridView.CellContentClick
    
        End Sub
    
        Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
            If First_NameTextBox.Text = Nothing Then
                First_NameTextBox.Text = "unknown"
            End If
            Me.Validate()
            Me.TenantTableBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.TenantDatabase1DataSet)
            Me.TenantTableTableAdapter.Fill(Me.TenantDatabase1DataSet.TenantTable)
            MessageBox.Show("Tenant Data Saved", "Data Saved", MessageBoxButtons.OK)
        End Sub
    
        Private Sub btnNewTenant_Click(sender As Object, e As EventArgs) Handles btnNewTenant.Click
            Try
                TenantTableBindingSource.AddNew()
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub
    
        Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
            Select Case MsgBox("Are you sure you want to delete tenant", MsgBoxStyle.YesNo, "Are you sure")
                Case MsgBoxResult.Yes
                    Try
                        TenantTableBindingSource.RemoveCurrent()
                    Catch ex As Exception
                        MessageBox.Show(ex.Message)
                    End Try
                Case MsgBoxResult.No
                    ''nothing
            End Select
        End Sub
    
        Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
            Application.Exit()
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            TenantTableBindingSource.MovePrevious()
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            TenantTableBindingSource.MoveNext()
        End Sub
    End Class


    Wednesday, April 19, 2017 2:15 PM
  • What did you see on his monitor? How was the image of your application?

    Wednesday, April 19, 2017 9:24 PM
  • Hi mega_noob,

    If you are using Winforms, then the chances are you can't do it with any real success. In Winforms, just changing the size of a total form does not automatically affect the size of it's content - it can, if you have the Anchor and Dock properties set correctly, but even then, it doesn't affect the size of text in buttons, labels and so forth. 
    There is no real short cut. The best solution is to design the form to work with a minimum resolution, and allow the user to scale up from that, rather than start with a maximum resolution and try to scale down.

    You can try the code below, this line can only modify size of window-form (it will not effect controls' locations & size)

    Me.Size = Screen.PrimaryScreen.WorkingArea.Size
    

    For fit your form in any window use.

    Me.windowstate = maximized

    Hope it is helpful to you.

    Best Regards,

    Cherry Bu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 20, 2017 8:09 AM
    Moderator