|
ActiveX!!!!! You do realise that this is a C# forum don't you?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi all,
I am using a listview to display a set of titles.I need to set the width of these items dynamically.Each item has its own number of characters and the width has to be adjusted accordingly. I am not using a columnheader.These are items which are added dynamically.
I tried giving this code as suggested in some of the sites.
for each (col in listview1.columns)
{
col.width=-1;
}
but still i am not able to set the width of the item.
Any ideas on this.
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Hi,
At any time you can only specify the width of each column only..And not the width of each item...
For example,let the name of the ListView as "Logs".
You can add the columns like,
Logs.Columns.Add("Column1", 100, HorizontalAlignment.Center); where the second parameter (100) is the width of the first column... You can change this value to any number.
While adding the subitems , first you create a parent item
ListViewItem lList = new ListViewItem("Employee Name");//Parent Listview item
Then add the sub items to teh parent one...
lList.SubItems.Add("ABCD");
lList.SubItems.Add("EFGH"); Etc.,
Finally,
Logs.Items.Add(lList);
Thanks & Rgds,
Sri..
|
|
|
|
|
Please let me know if it is posssible to use instance of one application into another ? For example, i have one application, I am creatiing a instance for it, I want to access this same instance into other application.
|
|
|
|
|
Don't put the entire post as subject. It's too much text to be useful as a subject.
What exactly do you mean by accessing an instance of an application? What is is that you are trying to accomplish?
You can start another application from one application. If you start a console application, you can redirect the input and output to streams that you create yourself.
---
single minded; short sighted; long gone;
|
|
|
|
|
Suppose I have an application A. I create a instance of it. Now I want to access this existing instance of application A into application B.
|
|
|
|
|
You've just said the same thing again. Repeating an unclear instruction doesn't make it any clearer.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have an appplication A, which has a method to save information regarding the status of the application whenever the application closes abruptly. I want to access this method in my windows service and save the status of the application A whenever the application closes abruptly.
|
|
|
|
|
Hi
i am using "System.Drawing.Printing.PrintDocument" so when I call print method of this class printer starts printing my documnet but I do not want to print. I want to save the output of this class on the hard disk. Is there any way to sotp printing. My code is given below -
MyPrintObject.PrinterSettings.PrintToFile = true;<br />
MyPrintObject.PrinterSettings.PrintFileName = @"c:\abc.tiff";<br />
MyPrintObject.PrinterSettings.PrinterName = "Zan Image Printer";<br />
MyPrintObject.Print();
Reagards
Saurabh Gupta
Saurabh Gupta
Software Engineer
|
|
|
|
|
I have to export crystal report data into excel.To achieve that, I have written coding like this
MemoryStream oStream;
oStream=(MemoryStream)(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.clear();
Response.Buffer=true;
Response.ContentType="application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
But i am getting compile-time error such as
"Cannot convert type 'CrystalDecisions.Shared.ExportFormatType.PortableDocFormat' to 'System.IO.MemoryStream' "
Can anyone help point out what mistake i have done on coding.
Thanks in advance
Shanthi
|
|
|
|
|
|
Thank you so much for your timely help.
|
|
|
|
|
Hello...
I have a problem. I have a treeView and 3 nodes in it with checkboxes.
I want to check only one of the checkboxes. How can I do that ?
That means, if I check the second node, the first & third node must be uncheck automatically.
That can be done using radioButton, but I dont want to use radiobutton.
Any idea ?
Thanks...
|
|
|
|
|
stancrm wrote: I have a treeView and 3 nodes in it with checkboxes.
I want to check only one of the checkboxes
Maybe you can loop through the other nodes in the TreeView and uncheck them?
|
|
|
|
|
If you try to do this with checkboxes, you are breaking with the whole visual approach that users expect from them and you will only end up confusing. Checkboxes mean that multiple items can be selected. Radiobuttons mean that only one item can be selected. Don't break with Windows conventions unless you have a really good reason to do so.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I am hoping someone can help, I have created a form which is populated at specific locations with textbox's at runtime, what i would like to be able to do is set the name of the textbox's when they are created from a specific string which would change for each textbox.
I am hoping someone can tell me how to do this, thank you for any help.
|
|
|
|
|
You can use the textBox.Name property to set the name. If the idea is to distinguish b/w textbox you can consider setting unique value to tag property as well.
Let me know if it helps.
|
|
|
|
|
Hi I'm using C#2.0 to read mails from Exchange Server 2003 through following code.
namespace ReadOutlook<br />
{<br />
class Class2<br />
{<br />
public void read()<br />
{<br />
try<br />
{<br />
ADODB.Connection oCn = new ADODB.Connection();<br />
ADODB.Recordset oRs = new ADODB.Recordset();<br />
<br />
ADODB.Fields oFields;<br />
ADODB.Field oField;<br />
<br />
string sFdUrl = "http://Exchange/Exchange/UserId/Inbox";
<br />
oCn.Provider = "exoledb.datasource";
oCn.Open(sFdUrl, "", "", -1);<br />
<br />
if (oCn.State == 1)<br />
{<br />
Console.WriteLine("Good Connection");<br />
}<br />
else<br />
{<br />
Console.WriteLine("Bad Connection");<br />
}<br />
<br />
<br />
string strSql;<br />
strSql = "";<br />
strSql = "select ";<br />
strSql = strSql + " \"urn:schemas:mailheader:content-class\"";<br />
strSql = strSql + ", \"DAV:href\" ";<br />
strSql = strSql + ", \"urn:schemas:mailheader:content-class\" ";<br />
strSql = strSql + ", \"DAV:displayname\"";<br />
strSql = strSql + " from scope ('shallow traversal of " + "\"";<br />
strSql = strSql + sFdUrl + "\"') ";<br />
strSql = strSql + " WHERE \"DAV:ishidden\" = false";<br />
strSql = strSql + " AND \"DAV:isfolder\" = false";<br />
<br />
<br />
oRs.Open(strSql, oCn,<br />
ADODB.CursorTypeEnum.adOpenUnspecified,<br />
ADODB.LockTypeEnum.adLockOptimistic, 1);<br />
<br />
<br />
oRs.MoveFirst();<br />
<br />
oFields = oRs.Fields;<br />
<br />
string sUrl;<br />
oField = oFields["DAV:href"];<br />
sUrl = oField.Value.ToString();<br />
<br />
CDO.Message iMsg = new CDO.Message();<br />
iMsg.DataSource.Open(sUrl, oRs.ActiveConnection,<br />
ADODB.ConnectModeEnum.adModeReadWrite,<br />
ADODB.RecordCreateOptionsEnum.adFailIfNotExists,<br />
ADODB.RecordOpenOptionsEnum.adOpenSource,<br />
"", "");<br />
<br />
Console.WriteLine("{0}", iMsg.Sender);<br />
Console.WriteLine("{0}", iMsg.Subject);<br />
Console.WriteLine("{0}", iMsg.TextBody);<br />
<br />
oFields = iMsg.Fields;<br />
<br />
<br />
for (int i = 0; i < oFields.Count; i++)<br />
{<br />
oField = oFields[i];<br />
Console.WriteLine("{0} : {1}", oField.Name, oField.Value);<br />
}<br />
<br />
<br />
oRs.Close();<br />
oCn.Close();<br />
<br />
oCn = null;<br />
oRs = null;<br />
oFields = null;<br />
oField = null;<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine("{0} Exception caught.", e);<br />
}<br />
}<br />
}<br />
}
I'm getting following exception. I've tried installing exoledb.dll but I could not install it.
e = {"Provider cannot be found. It may not be properly installed."}
Anyone has any idea to install the provider or any other way of reading the mails from exchange server through Code.
Thanks
Don't Quit
|
|
|
|
|
I got it to run. Others may benefit from this solution.
Just change exoledb.datasource to MSDAIPP.DSO while specifying provider. If anyone has link to a good resource for Exchange server related tasks with dot net Please share it.
Thanks
Don't Quit
|
|
|
|
|
I have a problem deleting a directory, when that directory is already open by another application (like WExplorer, or TCommander). I get the well known exception ".. the process cannot access the file because is used by another application". How can I get around this ? (TCommander as far as I've seen can delete a dir, even if the dir is open by explorer, so something can be done...).
Thanks in advance to all that may give me some info on this problem.
|
|
|
|
|
You would have to setup a try catch statement to catch when the exception occurs and see what the program can do to fix the issue, and if it can't you could possibly tell the user which program is causing the error and needs to be closed.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Is there any library to do reorder item in form?
-- modified at 4:24 Thursday 8th March, 2007
|
|
|
|
|
hi all,
i have a little problem that is driving me insain!
i've made a program to connect to an divec or pc u name it, but sometimes i cant get a connection although i can ping to it? i dont know mutch about networks so i dont see the problem, i am sure that my "make connection" code is wright because i am able to make connection at times
i should say that i am using wireless connection, so the device i am calling comes and goes
its seems that sometimes the application runs without any problems.
the device comes in reach i can ping and i get a connection and than the device leaves again and comes back ping and connect, no problem at all.
BUT other times it comes in i get ping, connection, it leaves, comes back, ping but no connection ever again, i have to restart the device before i get can make a connection
does anybody hase any expericence on this subject
any help or tips are welcom
thx its urgent
grz muk
|
|
|
|
|
I am getting an Error while Exporting from crystal report to PDF.
cannot convert type 'CrystalDecisions.Shared.ExportFormatType' to 'System.IO.MemoryStream'
Can any one help me pls. thanks in advance.
A.Surenth
|
|
|
|
|
Hi
I think you need to type cast to Memory Stream from ReportDocument. See the sample code below for exporting from Crystal Report to PDF.
MemoryStream oStream;
rptDocument.SetDatabaseLogon(StrUID, StrPwd, StrServer, StrDatabase);
oStream = (MemoryStream)rptDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
I used Crystal Report 10 in VS2005.
Rate this message. Thank you. Harini
|
|
|
|