|
How do you want to display the image?
Can you give more details of what you require?
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
i m using VC# using smartphone 2003.one image is dispalyed as a back ground image and another image(Stretchimage) is displayed as a superimposed on the background Image. the stretch image should be displayed in run time only.
direct path of the image should not be given. we declare in one variable(in that variable we have to give the path) and we call that variable whereever we want.
|
|
|
|
|
So basically:
[object].BackgroundImage = Image.FromFile(yourfilenamehere);
Is that what you want, or do you want it embedded in the executable? (It doesn't sound as if you want this done)
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
hi
i already tried that one but... it is not working. can u send ur gmail id.
just i chat n clear my all doubts.. pls
asdfd fghdfg
|
|
|
|
|
Kmurthy wrote: it is not working
What's the error message or compiler error displayed?
Kmurthy wrote: can u send ur gmail id
I can, but then if we find a solution other people can't benefit your problem (which is one of the ideas behind these forums).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
tat is ur wish. one image is dispalyed as a back ground image and another image(Stretchimage) is displayed as a superimposed on the background Image. how to display this one.
|
|
|
|
|
Kmurthy wrote: superimposed
What do you mean by this, is part of the image transparent?
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
no,two different images.first one is the background image.another one is superimposed on the background image.no transparent images.
|
|
|
|
|
Easiest way would be to add a PictureBox control at runtime and load the picture from the file, e.g.
void LoadPicture()
{
PictureBox picBox = new PictureBox();
picBox.Dock = DockStyle.Fill;
picBox.Image = Image.FromFile(filename);
this.Controls.Add(picBox);
}
-- modified at 6:48 Tuesday 1st August, 2006
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
when im using the from file it displays the error like this. 'System.Drawing.Image' does not contain a definition for 'FromFile'
|
|
|
|
|
Try:
.BackgroundImage = new Bitmap(filename);
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
stil it gives the same error. and there is no property called "BackgroundImage".
|
|
|
|
|
Sorry it's the Image property on the PictureBox control.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
after using image property also,it gives the same error.
In FromFile we have to give the filename or the path of the image.
asdfd fghdfg
|
|
|
|
|
Kmurthy wrote: In FromFile we have to give the filename or the path of the image.
They're the same thing aren't they, you can use a relative path or an absolute one as long as the image is somewhere on the filesystem.
Check the documentation for the Image object and see which methods are supported by the CF (I don't use the compact framework so I'm guessing (intuitively) here).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
i m trying the to execute the code the following error occuring.
"Not all code path returns a value"
public DataSet RSopen(string sQuery, OleDbConnection ConnObj, string szUseTransactionObj)
{
try
{
m_ConnObj=ConnObj;
//szUseTransactionObj="";
m_Adapter.SelectCommand = new OleDbCommand(sQuery, m_ConnObj);
if ((szUseTransactionObj == "YES"))
{
m_Adapter.SelectCommand.Transaction = m_DataConrol.GetTransactionObj();;
}
//szUseTransactionObj="";
m_Adapter.Fill(m_Dataset);
m_CurrentRow = 1;
m_Table = m_Dataset.Tables["Chartofacct"];
m_TotalRows = m_Table.Rows.Count;
return m_Dataset;
}
catch (Exception e)
{
e.ToString();
}
}
Shahzad
|
|
|
|
|
try out
public DataSet RSopen(string sQuery, OleDbConnection ConnObj, string szUseTransactionObj)
{
try
{
m_ConnObj=ConnObj;
//szUseTransactionObj="";
m_Adapter.SelectCommand = new OleDbCommand(sQuery, m_ConnObj);
if ((szUseTransactionObj == "YES"))
{
m_Adapter.SelectCommand.Transaction = m_DataConrol.GetTransactionObj();;
}
//szUseTransactionObj="";
m_Adapter.Fill(m_Dataset);
m_CurrentRow = 1;
m_Table = m_Dataset.Tables["Chartofacct"];
m_TotalRows = m_Table.Rows.Count;
return m_Dataset;
}
catch (Exception e)
{
e.ToString();
return new m_Dataset();
}
}
rahul
|
|
|
|
|
The reason you get this compilation error is that you method declares that it will return an instance of DataSet, but not all paths return such an instance. Look at what happens if an exception is raised.
To solve this, you need only to put this line:
Shahzad.Aslam wrote: return m_Dataset;
outside of the try{}catch{} block.
public DataSet RSopen(string sQuery, OleDbConnection ConnObj, string szUseTransactionObj)
{
try
{
m_ConnObj=ConnObj;
m_Adapter.SelectCommand = new OleDbCommand(sQuery, m_ConnObj);
if ((szUseTransactionObj == "YES"))
{
m_Adapter.SelectCommand.Transaction = m_DataConrol.GetTransactionObj();;
}
m_Adapter.Fill(m_Dataset);
m_CurrentRow = 1;
m_Table = m_Dataset.Tables["Chartofacct"];
m_TotalRows = m_Table.Rows.Count;
}
catch (Exception e)
{
e.ToString();
}
return m_Dataset;
}
-- modified at 6:27 Monday 31st July, 2006
|
|
|
|
|
Hi all.
Quick question, I want to use cab file to update my app instead of reinstalling everytime I need to update, so I set the installer to create cab files, no I sit with a zip folder with 300 files in it, how do I actualy use them, also I have no idea what the cab files are, looke like it uses some kind of encryption with the anming of the files.
Can anyone help please or suggest where to look.
Thanx in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi all,
How to set a startup form in c# windows application ?
|
|
|
|
|
In the Main method there will be a line like this:
Application.Run(new StartUpForm());
Change the form that is instantiated.
|
|
|
|
|
u can set the startup object or form from VS project menus project property
option
rahul
|
|
|
|
|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace PrintForm
{
///
/// Summary description for frmTest.
///
public class frmTest : System.Windows.Forms.Form
{
#region UI Variables
private System.Windows.Forms.Button btnPrint;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
#endregion
#region Constructors
public frmTest()
{
InitializeComponent();
}
#endregion
#region Windows Form Designer generated code
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.btnPrint = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// btnPrint
//
this.btnPrint.Location = new System.Drawing.Point(104, 328);
this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(120, 40);
this.btnPrint.TabIndex = 1;
this.btnPrint.Text = "Print this form";
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(88, 32);
this.label1.TabIndex = 2;
this.label1.Text = "Name";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 80);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 24);
this.label2.TabIndex = 3;
this.label2.Text = "IC";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// button1
//
this.button1.Location = new System.Drawing.Point(24, 128);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(56, 32);
this.button1.TabIndex = 4;
this.button1.Text = "Receipt";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(128, 32);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(208, 20);
this.textBox1.TabIndex = 5;
this.textBox1.Text = "textBox1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(128, 80);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(208, 20);
this.textBox2.TabIndex = 6;
this.textBox2.Text = "textBox2";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(128, 136);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(208, 20);
this.textBox3.TabIndex = 7;
this.textBox3.Text = "textBox3";
//
// frmTest
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(360, 390);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnPrint);
this.Name = "frmTest";
this.Text = "Test Form";
this.ResumeLayout(false);
}
#endregion
#region Main
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new frmTest());
}
#endregion
#region UI Event Handlers
private void btnPrint_Click(object sender, System.EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;
PrintForm pf = new PrintForm(this);
pf.Print();
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
finally
{
this.Cursor = Cursors.Default;
}
}
#endregion
private void button1_Click(object sender, System.EventArgs e)
{
int counter;
counter = 50;
int i;
Random r = new Random();
for(i =0;i
|
|
|
|
|
Hi,
Can u make ur problem more clearer please. tell me wht u want to do. is it just u want to print a form. or something like that.
Vipin
|
|
|
|
|
hi thanks for all help.. managed to log in only now.. i actually mean i have done a print application..however when i link it to my main application, it cant work as now i have 2 main entry point..how do i go abt doing this??
really appreciate yr help vipin
|
|
|
|