Just for the fun of it I have created a Windows Forms application on a Windows 10 desktop with latest version/build using Visual Basic 2019 to enter contact details such as name, address, city, etc. The data is then stored in SQL Server. That part works flawlessly.
I use one main Form with a split container control (vertically split). The left panel holds fixed menu option buttons whilst in the right panel I store the various forms linked to the menu options. The first time a form is shown in this panel it is loaded and when another form is required I hide it and load or show the new form. The real action on these forms is done in the Form_Enter event. Nearly all forms are created holding a TableLayoutPanel to cope with different screen resolutions. Some forms also have Panel controls e.g. when Radio Button groups are used. The main form's AutoScaleMode is set to 'Font' - other options do not do the job properly!
I use two identical monitors one of which is on 125% text size and the other on 100%. When I move the app from one monitor to the other the main form adapts to the resolution immediately so also this part runs without problems.
One of the forms shows all contact details that can then be created, edited, or deleted. This includes a label design of which the layout follows international rules. The user can print this label to an installed label printer. In my case that is a Dymo Labelwriter 400. The printing itself functions as desired but there is a side effect the reason of which I do not understand. What happens is that as soon as the required label is opened (see code below) the main form's text size is reduced to 100%. So when I start the app on the 100% monitor nothing changes but when I start on the 125% monitor the form diminishes in a split second to 100%. And it stays like this until I restart the app.
When I start the app on my laptop with screen resolution 1366x768 and textsize 125% nothing happens. What puzzles me is what may cause this. Is it the monitor (2xAcer H223HQ)? Seems unlikely! Is it the video card? Or is it just VB.Net that does
I have simplified the label printing code but even then the odd behavior occurs. The code:
1. Dim myLabel As DYMO.Label.Framework.ILabel
2. myLabel = DYMO.Label.Framework.Framework.Open(Application.StartupPath & "\rvds.label")
3. myLabel.SetObjectText("TEXT", Trim(rtbContactLabel.Text))
4. myLabel.Print(gstrEenLabelPrinter)
Line 2 causes the problem.
Is there anyone who might know why this happens? I would appreciate your help!
Thanks!
I use one main Form with a split container control (vertically split). The left panel holds fixed menu option buttons whilst in the right panel I store the various forms linked to the menu options. The first time a form is shown in this panel it is loaded and when another form is required I hide it and load or show the new form. The real action on these forms is done in the Form_Enter event. Nearly all forms are created holding a TableLayoutPanel to cope with different screen resolutions. Some forms also have Panel controls e.g. when Radio Button groups are used. The main form's AutoScaleMode is set to 'Font' - other options do not do the job properly!
I use two identical monitors one of which is on 125% text size and the other on 100%. When I move the app from one monitor to the other the main form adapts to the resolution immediately so also this part runs without problems.
One of the forms shows all contact details that can then be created, edited, or deleted. This includes a label design of which the layout follows international rules. The user can print this label to an installed label printer. In my case that is a Dymo Labelwriter 400. The printing itself functions as desired but there is a side effect the reason of which I do not understand. What happens is that as soon as the required label is opened (see code below) the main form's text size is reduced to 100%. So when I start the app on the 100% monitor nothing changes but when I start on the 125% monitor the form diminishes in a split second to 100%. And it stays like this until I restart the app.
When I start the app on my laptop with screen resolution 1366x768 and textsize 125% nothing happens. What puzzles me is what may cause this. Is it the monitor (2xAcer H223HQ)? Seems unlikely! Is it the video card? Or is it just VB.Net that does
I have simplified the label printing code but even then the odd behavior occurs. The code:
1. Dim myLabel As DYMO.Label.Framework.ILabel
2. myLabel = DYMO.Label.Framework.Framework.Open(Application.StartupPath & "\rvds.label")
3. myLabel.SetObjectText("TEXT", Trim(rtbContactLabel.Text))
4. myLabel.Print(gstrEenLabelPrinter)
Line 2 causes the problem.
Is there anyone who might know why this happens? I would appreciate your help!
Thanks!