'Windows forms scalling
I'm trying to avoid wrong form showing when "Scale and layout" in windows screen settings is different than 100%.
I've folloved this LINK, and it works but only in 2 cases
1 - in debugging mode in VS
2 - if i put my *.exe file together with *.manifest and *.config files in same location.
If *.exe is alone then it does not work.
I'm looking for a clue what to do next.
Update
This is how application is run.
Private Sub Monitor_Click(sender As Object, e As EventArgs)
Dim trd As New Thread(AddressOf ShowMonitor)
trd.SetApartmentState(Threading.ApartmentState.STA)
trd.Start()
End Sub
Private Sub ShowMonitor()
Dim frMonitor As System.Reflection.Assembly = System.Reflection.Assembly.Load(File.ReadAllBytes("path to folder with DLL files\Monitor.dll"))
Dim oType As System.Type
Dim pControl As System.Object
oType = frMonitor.GetType("Monitor.frmMonitor")
pControl = Activator.CreateInstance(oType)
Application.Run(pControl)
End Sub
So my "monitor" application works as expected only in 2 cases written above.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|