Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:27:51+00:00 2026-06-12T23:27:51+00:00

Currently, I have a UI where the user chooses a product from a list.

  • 0

Currently, I have a UI where the user chooses a product from a list. When they double click on the product of their choice another form shows the product with some additional information as well as the associated bar code. On this second form there is a print button. (This is where my question is) When the print button is clicked I want send this information to a Label Template and viewable (probably though a PrintPage) and then be able to be sent to a printer from that.

What is the best way to accomplish this? I can think of two different ways to accomplish this but I’m sure there are better ways out there.
1) I can create the template in XAML and then databind to the form
2) I can create the template in the form.vb ‘s _PrintPage event. (most straightforward but not the fastest)

  • Is there an easier way to create the template and send the information to it and then print the template?
  • It would be easier to just make another windows forms and design the template that way, but is it possible to send this form to a print object at runtime?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:27:52+00:00Added an answer on June 12, 2026 at 11:27 pm

    If I understand you correctly you want to control the process within your own program without using report tools? In that case I will list some thoughts about one implementation –

    You can make a simple template functionality using (a serializable) dictionary that contains regions and region types. As you work with an absolute area (the label itself) you can for example do this:

    Private Template as Dictionary = New dictionary(Of String, TemplateEntry)
    
    Friend Class TemplateEntry
        Public MeasureType As MeasureType
        Public RegionType As Regiontype
        Public X As Single
        Public Y As Single
        Public Width As Single
        Public Height As Single
        Public Content as Object
    End Class
    
    Friend Enum MeasureType
        Centimeters
        Millimeters
        Inches
        Pixels
        '...
    End Enum
    
    Friend Enum RegionType
        Text
        [Image]
        BarCode
        '...
    End Enum
    

    Then in you code you convert the x,y,w,h into pixels based on the DPI and return a Rectangle for example. You can XML Serialize the dictionary to create other templates and so forth.

    The Content field is initialized when parsed.

    To add you could do for example:

    Dim tmpl As TemplateEntry = New TemplateEntry
    tmpl.MeasureType = MeasureType.Millimeters
    '...
    
    Template.Add("Barcode", tmpl)
    

    Then “render” the template into your canvas for printing:

    For Each tLine in Template
        Dim r as rectangle = CalcMeasuresIntoPixels(tmpl)
        '...
        ' render each element based on type and location
    Next
    

    Hope this gave some input.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have form that checks if a user has unsubmitted changes when they
I currently have a wysiwyg iframe where the user can submit input to another
I currently have a user's table which contains a one-to-one relationship for Youtube OAuth
Currently I have a User table that has a toys_owned column that is an
I currently have three classes User , UserProfile , and Vendor . User is
I currently have two different models: User and Project . The User model has
I currently have two Backbone models: user and project. I would like to have
I currently have built a system that checks user IP, browser, and a random-string
I currently have some action associated with when the user types something in a
I've got a PHP-driven site that has a recordkeeping form. The user chooses a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.