フォームが読み込まれたときに、フォームを画面の右下隅に配置するにはどうすればよいですか? Visual Basic 2010 Expressを使用しています。
ありがとう
編集:私はこれをしました、そしてそれは素晴らしいようです。
Dim x As Integer
Dim y As Integer
x = Screen.PrimaryScreen.WorkingArea.Width - 400
y = Screen.PrimaryScreen.WorkingArea.Height - 270
Me.Location = New Point(x, y)
Form.StartPositionをManualに変更し、フォームのLocationプロパティを変更する必要があります
または
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Visible = True
Dim x As Integer
Dim y As Integer
x = Screen.PrimaryScreen.WorkingArea.Width
y = Screen.PrimaryScreen.WorkingArea.Height - Me.Height
Do Until x = Screen.PrimaryScreen.WorkingArea.Width - Me.Width
x = x - 1
Me.Location = New Point(x, y)
Loop
End Sub
センタースクリーン:
Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 2)
右下コーナー画面:
Me.Location = New Point(Screen.PrimaryScreen.WorkingArea.Width - Me.Width, Screen.PrimaryScreen.WorkingArea.Height - Me.Height)
単純にこれが私にとってトリックを実行します:タスカーのすぐ上/左のポジションは、ケースかもしれません。
Dim x As Integer
Dim y As Integer
x = Screen.PrimaryScreen.WorkingArea.Width - Me.Width
y = Screen.PrimaryScreen.WorkingArea.Height - Me.Height
Me.Location = New Point(x, y)
あなたは次のように試すことができます
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.StartPosition = FormStartPosition.Manual Me.Location = Screen.GetWorkingArea(Me).Location End Sub
画面のカーソルがオンになっているフォームを配置したい場合は、次を使用します。
' Get Active Screen Cursor is On, rather than assuming user on PrimaryScreen
Dim scr As Screen = Screen.FromPoint(Cursor.Position)
Me.Location = New Point(scr.WorkingArea.Right - Me.Width, scr.WorkingArea.Bottom - Me.Height)
子フォームをループして、上部と左のプロパティに基づいていくつかの計算を行うことができます(これらの計算を、「左下」の要件に応じて、幅と高さのプロパティと組み合わせたい場合があります)。
HTH、マーク