How Can I Create Address Label Details Window ? RRS feed

  • Question

  • Hi. I want to create Label Detail Window as same at dawn. (Visual Basic NET)

    I created but how can I adjust the labels size according to margins.

    I mean to say İf Labels + (text Labels) width larger then Preview window how can I make it smaller into Preview window ? 

    Name:  Laser Labels Setup.png
Views: 131
Size:  37.8 KB

    Or if you know another easier way for this ?

    Advanced Thanks.

    Wednesday, May 16, 2018 1:54 PM

All replies

  • How are you drawing the preview?  Manually with an instance of Graphics?  Or is this an existing preview control?

    If you are drawing the image yourself with Graphics then you can use ScaleTransform to "shrink" your drawing to fit.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Wednesday, May 16, 2018 2:15 PM
  • The picture is Microsoft Words Label Details Windows. I try to do smiliar. I used shape control as label. Or is my way wrong ?
    Wednesday, May 16, 2018 2:29 PM
  • The picture is Microsoft Words Label Details Windows. I try to do smiliar. I used shape control as label. Or is my way wrong ?

    Which version of visual basic are you using?

    If you are using vb.net then show an image of the dimension you want to adjust and the before and after positions.

    PS You mention the shape control, is that is vb.net? Is it the power tools? You don't need the power tools (is that the name?).

    Do you just need a basic example to follow or do you have code already that you can post?

    Wednesday, May 16, 2018 2:36 PM
  • PS Here is a quick simple example that I use for this type of thing.

    The example uses a predrawn bitmap image that remains static on a fixed size dialog type form. One could modify the exampe by drawing the image with code and or use pictureboxes etc.

    In this example the nud controls are just located ontop of the bitmap image. The image is drawn on the form in the paint event. Everything stays the same size on the fixed size dialog form.

    So then this can get as fancy as you want. You can make the image resize as desired with the nud valuechanged event etc. If thats what you want.

    What you need to watch then is when the deployment system video resolution changes. With this example it was arranged so there is room to "grow" on all the controls. If you plan on using many types of video then you need to deal with that somehow.

    Public Class Form4
        Private WithEvents NudWidth As New NumericUpDown With {.Parent = Me, .Location = New Point(100, 120),
            .Width = 50, .Height = 24, .Maximum = 10, .Minimum = 1, .Increment = CDec(0.1), .Value = 3}
        Private WithEvents NudHeight As New NumericUpDown With {.Parent = Me, .Location = New Point(220, 50),
            .Width = 50, .Height = 24, .Maximum = 10, .Minimum = 1, .Increment = CDec(0.1), .Value = 3}
        Private Bmp As New Bitmap("c:\bitmaps\dimension1.png")
        Private Sub Form4_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            e.Graphics.DrawImage(Bmp, 20, 20)
        End Sub
        Private Sub NudWidth_ValueChanged(sender As Object, e As EventArgs) Handles NudWidth.ValueChanged
        End Sub
    End Class

    The image on the form dialog is just this bitmap image I made in a CAD program (this could be drawn with code instead):

    Does that seem like what you want to do?

    Wednesday, May 16, 2018 3:33 PM