hi my name is vishal.
For 2weeks i have been breaking my head on how to show picturebox datas upon creation in c# windows forms with sql server2008?
I have a picturebox control
name:pictureBox1, enabled:
true and visible:
true
Inside the picturebox are
label control
name:lblPID,enabled:
true and visible:
true
This label control is on top of StrokeScribe control but
inside picturebox control
StrokeScribe
control name:barCOrg,enabled:
true and visible:
true
Given below is code on how i generate barcode using StrokeScribe control(barCOrg) in c# windows forms with sql server2008.:
namespace DRRS_CSharp
{
public partial class frmDialyzer : Form
{
int pUserID;
public frmDialyzer()
{
InitializeComponent();
SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
string PatientPull = ("select p.patient_id as patient_id,n.patient_first_name as patient_fname,n.patient_last_name as patient_lname from patient_name n,patient_id p where n.patient_id=p.patient_id and n.status =1 and p.patient_id not in (select d.patient_id from dialyser d where d.deleted_status=0)");
SqlCommand cmd = new SqlCommand(PatientPull);
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
PatientPull = dr[1].ToString() + "_" + dr[2].ToString() + "(" + "0000" + dr[0].ToString() + ")";
cboPatientID.Items.Add(PatientPull);
}
dr.Close();
}
private void button1_Click(object sender, EventArgs e)
{
barCOrg.Alphabet = STROKESCRIBELib.enumAlphabet.CODE128;
barCOrg.CtlText = txtDID.Text;
lblPID.Text = cboPatientID.Text;
int rc = 0;
rc = barCOrg.SavePicture("bar2.bmp", STROKESCRIBELib.enumFormats.BMP, barCOrg.Width, barCOrg.Height);
if (rc > 0)
{
MessageBox.Show(barCOrg.ErrorDescription);
}
if (MessageBox.Show("Dialyzer detail was added successfully.Do you want to print the barcode dialyzerID?", "DRRS", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
System.Diagnostics.Process.Start("bar2.bmp");
}
this.Close();
}
}
}
The above code executes well with no problem at all.
As you can see i save my created barcode image as bar2.bmp. I open my created barcode image in c# windows forms using System.Diagnostics.Process.Start("bar2.bmp");
But when opened my barcode image i get only created image of my StrokeScribe control(barCOrg) but i should also get data of label control(lblPID) along with bar2.bmp which is on top of StrokeScribe control(barCOrg) and both are inside picturebox control(pictureBox1).
I am aware that in order to accomplish this required result i have to use Shell functions.But i dont know what and where to use it.I know i have to do some modifications in my c# code.
Can anyone help me please?Any help/guidance in solving this problem would be greatly appreciated.