|
Hi.
I saw it somewhere for allocate an icon to a component.
What is the name of it ?
Has it a specific name ? ( Like attribute ! )
[System.Drawing.ToolboxBitmap(typeof(WebCamCapture), "CAMERA.ICO")]
Thank you
|
|
|
|
|
Mohammad Dayyan wrote: attribute
You got it!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
how i can use the openfiledialod and savefiledialog the return picture in c#
|
|
|
|
|
Uhmm, i don't think I understood your question. What do you mean with "return picture"?
Regards
Sebastian
|
|
|
|
|
You can configure to only select picture files, but it will still return a file path or a stream, it's up to you to load it as an image, and use it however you like.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If you are asking about to open and save only picture files then you have to add Filter to dialogs of all image file formats like *.jpg, *.gif, *.bmp
|
|
|
|
|
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "PNG|*.png|JPG|*.jpg";
if (ofd.ShowDialog() == DialogResult.OK)
Image img = Image.FromFile(ofd.FileName);
this may help
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
In my DeviceManager i can see 3xCOM port installed. Only one of them is physical port - 2 other are virtual. When I list them:
string[] portNames = SerialPort.GetPortNames();<br />
<br />
foreach (string port in portNames)<br />
{<br />
listBox1.Items.Add(port);<br />
}<br />
I get: COM1, COM2, COM3. It tells me nothing - only that 3 ports are installed in my computer. Other way is to use WMI. It works perfectly for physical ports.
<br />
SelectQuery query = new SelectQuery("select * from Win32_SerialPort");<br />
<br />
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);<br />
<br />
ManagementObjectCollection collection = searcher.Get();<br />
<br />
foreach (ManagementObject port in collection)<br />
{<br />
listBox2.Items.Add(port["Name"].ToString());<br />
}<br />
That way i get only "Name" (Communication Port) of the physical COM port but no virtual ports are listed.
My question is: How to get property "Name" or any other of the virtual serial ports.
Thanks in advance
ps. Sorry for my bad english :]
|
|
|
|
|
What name are you expecting to see ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
try this
listBox2.Items.Add(port["Caption"].ToString());
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi ,
Anybody please help me in this ..it is an urgent for me.
i am trying to fetch excel workbook dynamically but i am not get any idea about how to create an excel sheet object who help me for uploading the excel file dynamically using fileupload dialog box.
Here is my coad
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Core ;
using System.Data.OleDb;
using Excel;
using System.Reflection;
using Microsoft.Office.Tools.Excel;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
Excel.Workbook wb;
Excel.Worksheet ws;
public Form1()
{
InitializeComponent();
// wb = new Excel.Workbook();
//ws = new Excel.Worksheet();
}
// string filename = @"C:\tmp\SpreadsheetGearOleDbBenchmark.xls";
private void button1_Click(object sender, EventArgs e)
{
string filename = @"C:\abc.xls
String connectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
//String connectionString="Provider=Microsoft.Jet.OLEDB.4.0;"+"Data Source="+filename +";"+"Extended Properties=Excel 8.0;";
OleDbCommand selectCommand = new OleDbCommand ("SELECT * FROM [sheet1$]", connection);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
dataAdapter.SelectCommand = selectCommand;
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
// double sum = 0.0;
// We'll make some assumptions for brevity of the code.
System.Data.DataTable dataTable = dataSet.Tables[0];
dataGridView1.DataSource = dataSet.Tables[0];
MessageBox.Show(dataGridView1.RowCount.ToString());
connection.Close();
openFileDialog1.ShowDialog();
//openFileDialog1.ShowDialog();
// return sum;
// directorySearcher1.FindAll();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
openFileDialog1.ShowDialog();
Excel.Application excel = new Excel.Application();
}
}
}
|
|
|
|
|
I'm sorry, what it is exactly you're trying to do?
I understand you have an excel spreadsheet on your local drive and want to upload it somewhere...
Where?
What do you mean by "fetch an excel spreadsheet dynamically"?
Rephrase your post or do not, there is no "try" ;>
var question = (_2b || !(_2b));
|
|
|
|
|
here i read only one specific file in that program
i want to fetch excel file using file up load but i am unable to fetch acctual path of the file
I want to upload file on same com
|
|
|
|
|
how i can use the openfiledialod to open excel files in c# appilcation
|
|
|
|
|
openFileDialog1.ShowDialog();
System.Diagnostics.Process.Start(openFileDialog1.FileName);
No need upload anything. You have to have Excel installed, otherwise the system will not know what to do with the file.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi ,
Anybody please help me in this ..it is an urgent for me.
Actually i have a DataGridview in my window which should be with one fixed row and 2 fixed columns.
Fixedrow is done in Datagridview with the headercolumn property. Now i need to add 2 columns as fixed..
I tried with cell.frozen property, then the column is frozen, but still the tab control goes into this cells.and also it is not appearing same as column header.
Is there a way to make this 2 columns as rowheader?
In VB6 Flexgrid we have the option Fixedcols=2 ....is there any equivalent in DataGrideview windows C#?
Anyone please help me, asap...
Thanks in advance.
- Rami
|
|
|
|
|
Use TemplateFields and then set the AutoGenerateColumns= false. Hmmm I think I haven't understood your question clearly...anyways hope this one helps you
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Hi Spunky Coder,
Thanks for your reply
Can you explain me how to use Templatefields,
Actually i need to make my first 2 columns of my grid as fixed columns (row header)..
Thanks for your help...
-Rami.
|
|
|
|
|
he is not asking about asp
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I was saying about TemplateField property in a GridView. Huhhh I accept that these IDE's make me a bit lazy in remembering the syntax...I wonder how can I code without IDE's Intellisense Hey I'm sorry...I haven't realized that this is a C# forum
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
modified on Tuesday, March 17, 2009 6:25 AM
|
|
|
|
|
Hi Spunky coder,
There is no TemplateField Property in DataGridView of Windows C#...
Can you help me on this....
Thanks.,
-Rami.
|
|
|
|
|
I have an form which is called from another form.
How can i close the called form when i click a button in the parent form.
Thankyou,
YPKI
|
|
|
|
|
when you show that child form, keep its intance and call Close() when require.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Here is the code..
public partial class FormParent : Form
{
public FormParent()
{
InitializeComponent();
}
FormChild frmChild;
private void btnLoadForm2_Click(object sender, EventArgs e)
{
frmChild = new FormChild();
frmChild.Show();
}
private void btnCloseFrom2_Click(object sender, EventArgs e)
{
frmChild.Close();
}
}
|
|
|
|
|
Please Reply back to state whether you got what you want. .
This helps in unnecessary replies from other users. .
So if you are done with your query .. Please reply informing something like got you. .
Or completed . .
Please . .
|
|
|
|