Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

vb.net center form in screen

  Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Me.Size = New System.Drawing.Size(400, 650)
    Me.CenterToScreen()
End Sub
Comment

vb.net center form in screen

Public Shared Sub CenterForm(ByVal frm As Form, Optional ByVal parent As Form = Nothing)
    '' Note: call this from frm's Load event!
    Dim r As Rectangle
    If parent IsNot Nothing Then
        r = parent.RectangleToScreen(parent.ClientRectangle)
    Else
        r = Screen.FromPoint(frm.Location).WorkingArea
    End If

    Dim x = r.Left + (r.Width - frm.Width)  2
    Dim y = r.Top + (r.Height - frm.Height)  2
    frm.Location = New Point(x, y)
End Sub
Comment

PREVIOUS NEXT
Code Example
Csharp :: Code to disable Debug.log 
Csharp :: cmd move directory to another directory 
Csharp :: c# does value exist in list 
Csharp :: .net 4.5 use tls 1.2 
Csharp :: how to use buildcontext in initstate flutter 
Csharp :: preprocessors 
Csharp :: take photo function in unity 
Csharp :: C# Find first thing on a list 
Csharp :: how to get the today date in c# 
Csharp :: c# compare dateTime with string 
Csharp :: check if two date ranges overlap c# 
Csharp :: unity werfen mit höhe 
Csharp :: unity scene switch 
Csharp :: dataGridView default error dialog handle 
Csharp :: decimal operator in Convert.toDouble() C# 
Csharp :: Screen.lockcursor unity 
Csharp :: cdn providers 
Csharp :: C# top down view movement 
Csharp :: unity apply bloom of a different color 
Csharp :: get gameobject active state 
Csharp :: Advertisement code for unity 
Csharp :: How to install a windows service programmatically in C#? 
Csharp :: drawing default serializedproperty unity 
Csharp :: length of list c# 
Csharp :: how to make rabbitmq start and stop base on c# services 
Csharp :: boxing and unboxing in c# 
Csharp :: method c# 
Csharp :: c# while loops 
Csharp :: runtime save scene unity 
Csharp :: c# method 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =