Click here to Skip to main content
15,313,377 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# filter database through comboboxes Pin
R-Berg25-Jan-22 22:56
MemberR-Berg25-Jan-22 22:56 
GeneralRe: C# filter database through comboboxes Pin
RobertSF26-Jan-22 10:18
professionalRobertSF26-Jan-22 10:18 
QuestionCalling new Process, path problems Pin
Member 1495533220-Jan-22 23:08
MemberMember 1495533220-Jan-22 23:08 
AnswerRe: Calling new Process, path problems Pin
Richard MacCutchan20-Jan-22 23:41
mveRichard MacCutchan20-Jan-22 23:41 
AnswerRe: Calling new Process, path problems Pin
OriginalGriff20-Jan-22 23:48
mveOriginalGriff20-Jan-22 23:48 
QuestionPrinting two panels on a card back and front Pin
Member 1509338120-Jan-22 4:36
MemberMember 1509338120-Jan-22 4:36 
AnswerRe: Printing two panels on a card back and front Pin
OriginalGriff20-Jan-22 5:12
mveOriginalGriff20-Jan-22 5:12 
GeneralRe: Printing two panels on a card back and front Pin
Member 1509338120-Jan-22 8:05
MemberMember 1509338120-Jan-22 8:05 
Thanks so much for your quick response

I actually wrote a biometric c# program on windows form
i have no issue on this but now want to use the information in the database to print id card for each record in the database. My program can successfully retrieve the record and put them in the idcard. I put the controls such as textbox and labels in panel1 (front) and panel2 for back card. My small program using printdialogue and printview shows only one panel on printer dialogue view. My problem is that i want it to print the two panels. one in the front and the other in the back. I am using fargo HD5000 Id card printer that has ability to print on both front and back of the card automatically. I am using printing feature for the first time. And I am surely not getting it right. Please help. I would have posted my screen short but I dont no how to attach it
  using System;
using System.Drawing;
using System.Windows.Forms;
using Spire.Barcode;

namespace camera2
{
    public partial class Form2 : Form
    {
        Bitmap bitmap;
        //

<pre>
    public Form2()
    {
        InitializeComponent();
    }

    private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
    {
      //  using System.Drawing.Printing;
        e.Graphics.DrawImage(bitmap, 0, 0);
    }

    private void CaptureScreen()
    {
        Graphics myGraphics = this.CreateGraphics();
        Size s = this.Size;
        bitmap = new Bitmap(s.Width, s.Height, myGraphics);
        Graphics memoryGraphics = Graphics.FromImage(bitmap);
        memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);
    }
    private void print_Click(object sender, EventArgs e)
    {
        PrintDialog pDialog = new PrintDialog();
        pDialog.AllowSomePages = true;
        if (pDialog.ShowDialog(this) == DialogResult.OK)
        // this.printDoc.Print();
        {
           // Front card panel 1 
            Panel panel = new Panel();
            panel1.Size = new System.Drawing.Size(600,600);
            this.Controls.Add(panel);
            Graphics grp = panel.CreateGraphics();
            Size formSize = this.ClientSize;
            bitmap = new Bitmap(formSize.Width, formSize.Height, grp);
            grp = Graphics.FromImage(bitmap);
            Point panelLocation = PointToScreen(panel.Location);
            grp.CopyFromScreen(panelLocation.X, panelLocation.Y, 0, 0, formSize);
            printPreviewDialog1.Document = printDocument1;
            printPreviewDialog1.PrintPreviewControl.Zoom = 1;
            printPreviewDialog1.ShowDialog();

            // back card panel 2

            Panel panel2 = new Panel();
            panel2.Size = new System.Drawing.Size(600, 600);
            this.Controls.Add(panel);
            Graphics grp1 = panel.CreateGraphics();
            Size formSize1 = this.ClientSize;
            bitmap = new Bitmap(formSize.Width, formSize.Height, grp);
            grp1 = Graphics.FromImage(bitmap);
            Point panelLocation1 = PointToScreen(panel2.Location);
            grp.CopyFromScreen(panelLocation1.X, panelLocation1.Y, 0, 0, formSize1);
            printPreviewDialog1.Document = printDocument1;
            printPreviewDialog1.PrintPreviewControl.Zoom = 1;
            printPreviewDialog1.ShowDialog();

        }
    }

GeneralRe: Printing two panels on a card back and front Pin
OriginalGriff20-Jan-22 8:12
mveOriginalGriff20-Jan-22 8:12 
GeneralRe: Printing two panels on a card back and front Pin
Luc Pattyn20-Jan-22 9:05
sitebuilderLuc Pattyn20-Jan-22 9:05 
GeneralRe: Printing two panels on a card back and front Pin
RobertSF20-Jan-22 11:09
professionalRobertSF20-Jan-22 11:09 
Generalbtn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Member 1356965020-Jan-22 4:31
MemberMember 1356965020-Jan-22 4:31 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Dave Kreskowiak20-Jan-22 5:09
mveDave Kreskowiak20-Jan-22 5:09 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Member 1356965020-Jan-22 5:20
MemberMember 1356965020-Jan-22 5:20 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Dave Kreskowiak20-Jan-22 9:42
mveDave Kreskowiak20-Jan-22 9:42 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Member 1356965020-Jan-22 10:00
MemberMember 1356965020-Jan-22 10:00 
QuestionExceptions Pin
Simon_Whale17-Jan-22 2:30
professionalSimon_Whale17-Jan-22 2:30 
AnswerRe: Exceptions Pin
CHill6017-Jan-22 3:08
mveCHill6017-Jan-22 3:08 
GeneralRe: Exceptions Pin
Simon_Whale17-Jan-22 3:53
professionalSimon_Whale17-Jan-22 3:53 
AnswerRe: Exceptions Pin
OriginalGriff17-Jan-22 3:41
mveOriginalGriff17-Jan-22 3:41 
GeneralRe: Exceptions Pin
Simon_Whale17-Jan-22 3:53
professionalSimon_Whale17-Jan-22 3:53 
AnswerRe: Exceptions Pin
Luc Pattyn17-Jan-22 3:59
sitebuilderLuc Pattyn17-Jan-22 3:59 
QuestionRe: Exceptions Pin
Simon_Whale18-Jan-22 5:05
professionalSimon_Whale18-Jan-22 5:05 
AnswerRe: Exceptions Pin
Gerry Schmitz17-Jan-22 6:07
mveGerry Schmitz17-Jan-22 6:07 
GeneralRe: Exceptions Pin
Simon_Whale18-Jan-22 5:06
professionalSimon_Whale18-Jan-22 5:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.