|
-
Aug 23rd, 2017, 05:14 AM
#1
Thread Starter
Member
VB.NET : Me.Width= Screen.Allscreen(0).Bound.Width give wrong result.
Hi All,
Code:
Private Sub Form1_Resize(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Me.Resize
On Error Resume Next
If Me.WindowState = 1 Then Exit Sub ' if minimized do not set width and height
If Me.WindowState = 2 Then Exit Sub ' if maximized do not set width and height
If testScaling = 0 Then
testScaling = 1
End If
Me.Width = (Screen.AllScreens(0).Bounds.Width / testScaling)
Me.Height = (Screen.AllScreens(0).Bounds.Height / testScaling)
End Sub
in this Me.Height give wright result but Me.Width give multiple of two monitor width so application streched in both monitor.
under form_load
we have written
Code:
Dim myScreens() As Screen = Screen.AllScreens
Dim tempitem As Screen
For Each tempitem In myScreens
If tempitem.Primary = True Then
mainscreen = tempitem
End If
Next
Me.Width = myScreens(0).Bounds.Width
Me.height= myScreen(0).Bounds.Height
could you please help me to solve this issue.
I maked my application as screen saver in window. Once window satrt it start my screen saver and in that case my application look strech because of Me.Width taking double of original value.
Kindly help me to resolve this issue. I tried several way but it is not working
-
Aug 23rd, 2017, 05:33 AM
#2
Thread Starter
Member
Re: VB.NET : Me.Width= Screen.Allscreen(0).Bound.Width give wrong result.
My screen resolution is width=1920, Height=1080
But it showing Me.width=3840 and Me.Height= 1080
-
Aug 23rd, 2017, 01:10 PM
#3
New Member
Re: VB.NET : Me.Width= Screen.Allscreen(0).Bound.Width give wrong result.
I tested this Code and it was working. can You Show Your Full Code?
-
Aug 29th, 2017, 11:46 AM
#4
Thread Starter
Member
Re: VB.NET : Me.Width= Screen.Allscreen(0).Bound.Width give wrong result.
Thanks you so much ,i did mistake,it is working fine
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|