Site feedback

RuudvanderSpoel-9726 avatar image
0 Votes"
RuudvanderSpoel-9726 suggested TracyMyles commented

Dymo Label Printing causes Forms resolution change

Just for the fun of it I have created a Windows Forms application on a Windows 10 desktop 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 size is reduced to 100% text. So when I startb the app on the 100% monitor nothing changes but when I start on the 125% monitor is dimishes in a split second to 100%. And it stays like this until a new run.

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!


windows-forms
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@RuudvanderSpoel-9726 , thank you for the feedback. This area is specifically for Microsoft Q&A feedback only, due to this, we are closing this item.

0 Votes 0 ·

No Solutions

Your Opinion Counts

Share your feedback, or help out by voting for other people's feedback.