|
How about using a CheckBoxList (which exactly fits your requirement) rather than a multiline textbox (which exactly doesn't)?
[edit] 3 same answers on the same minute. Thats gotta be a record!
|
|
|
|
|
Thanks I ll try the checkBoxList
You guys are very fast
|
|
|
|
|
It works now what I really want to do is printing my outlook contacts to this CheckedListBox.
Right now I can pop the Outlook Contacts from my application with the below code.
I wonder how can i print the names + fax numbers only in that checkedlistBox
Thanks
try
{
Outlook.Application oApp = new Outlook.Application();
// Get the NameSpace information.
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
// Log on by using a dialog box to choose the profile.
oNS.Logon(System.Reflection.Missing.Value, System.Reflection.Missing.Value, true, true);
// Get the default Contacts folder.
Outlook.MAPIFolder oContacts = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
// Get the Items collection from the folder.
Outlook.Items oItems = (Outlook.Items)oContacts.Items;
// Get the first contact item in the Items collection.
Outlook.ContactItem oCt = (Outlook.ContactItem)oItems.GetLast();
string faxNum;
faxNum = oCt.BusinessFaxNumber.Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", "");
this.txtRecipientFax.Text = faxNum;
|
|
|
|
|
Hi,
I'm building a logger for my app:
StackTrace stackTrace= new StackTrace(objException);
StackFrame stackFrame = stackTrace.GetFrame(0);
MethodBase methodBase = stackFrame.GetMethod();
I know I can get the params names with:
methodBase.GetParameters();
How can I get the run time values of the params?
Moreno
|
|
|
|
|
It's not possible to get the values of the parameters through the StackFrame or through reflection.
You could use the ICorDebug[^] interface (more info on MSDN[^]) to get the values. Basically, you would be writing your own debugger. This is the same interface used by Visual Studio.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
But using the System.Diagnostics.StackFrame class will allow you to navigate the stack and by using the meta data you can read the values.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I guess not. It seems you have to use a combination of MSIL and the MethodInfo object. This should allow you up and down the stack but what a mess?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
How can I do that?
Mybe the only way is to send the values with the exeption
Moreno
|
|
|
|
|
You can offset to the stack just like you would when doing inline asm in C++, however, considering the nature of .NET it seems like code that could break really easily.
If you are doing a web method I know a way to log those dynamically with attributes through soap extensions but for normal methods I am out of ideas.
Sending the error values with an exception is a good idea. In fact, your exception should be specifically typed to your needs and not take an empty constructor anyway. Also, if your method takes more than a few (3?) arguments consider creating an object for parameters for the specific method.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
hi friends!
im converting a report to pdf and sending it as a mail attachment now what i need to do is password protect this pdf attachment...have anyone any ideas /suggestions???
pls help!
|
|
|
|
|
oh i need to do this programmatically through c#(if that was not obvious before ) thanks !
|
|
|
|
|
Hello,
Sorry for my bad English... I want to decode a eMail's sujet because it's the windows-1252 or iso-8859-1 encoding...
How to do that ?
thank you.
Mick@
|
|
|
|
|
Have you looked at the System.Net.Mail.MailMessage class?
|
|
|
|
|
Yes... And no methode exist for decoding...
Mick@
|
|
|
|
|
Maybe this [^]will help you
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
thank you... But I try and its no work... there is my code :
Encoding encodeWidows1252 = Encoding.GetEncoding(1252);
Encoding encodeUTF8= Encoding.UTF8;
Byte[] tabByte = encodeUTF8.GetBytes(texte);
return Encoding.GetEncoding(1252).GetString(tabByte);
Mick@
|
|
|
|
|
Nobody can tell me what the problem ?
Mick@
|
|
|
|
|
Hi,
Sometimes when I perform a system task in my application, like copying a file, writing to the registry etc., it takes some time for that task to complete. And for that period my application seems to hang.
I can solve this problem by running this task in a separate thread.
But what i really want to show to the user is that how the task is progressing (via a ProgressBar).
How do I accomplish this?
regards,
Ratish Philip.
|
|
|
|
|
Use BackGroundWorker component. It can report progress during the operation
|
|
|
|
|
Hey,
I looked up BackgroundWorker component in the Web. It is an excellent class. But everywhere, in the example, they run a loop in the DoWork method and within the loop they call the ReportProgress method which in turn updates the progress bar.
What if the DoWork method contains a single line line instead of a loop (as in the case of copying a file or writing a value to the registry). Then how & when do we call the ReportProgress method?
|
|
|
|
|
|
Thanks a ton.
Ratish Philip
|
|
|
|
|
plz anyone know about displaying data in excel files using c# on command prompt thats using console application plz help me
|
|
|
|
|
ramyanaidu wrote: plz anyone know about displaying data in excel files using c# on command prompt thats using console application
You want to write data to an excel file, or read from it?
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|