|
Am trying to make the label's text to the current time, but not using the 'static' DateTime.Now property which I tried to use lately.
How can I go about it.Please help.
|
|
|
|
|
Use BackGroundWroker Process (i.e. a different thread) to update the time on label after every 1 sec(or whatever interval you like)
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You could use the Timer class, which is simpler than explicitly creating another process:
protected Timer tim = new Timer();
...
tim.Tick += new EventHandler(tim_Tick);
tim.Interval = timerInterval;
...
private void tim_Tick(object sender, EventArgs e)
{
}
|
|
|
|
|
avoid using threads to update your gui , insted use events .
also you can use DateTime.Now to get the time
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
I have threads update my GUI all the time, but they have to be done properly.
I don't see how an event would help avoid using a thread.
|
|
|
|
|
System.Nvarchar does not exist... does anyone know how to do this?
bulkCopy.WriteToServer throws an exception because it cannot put a string into nvarchar...
dc.DataType = System.Type.GetType("System.Nvarchar");
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Mogaambo wrote: System.Nvarchar does not exist
Where did you read that it is a datataype in .Net?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Probably his MySQL or Oracle book
|
|
|
|
|
The DataType should be System.String .
|
|
|
|
|
try this:
SqlDbType.NVarChar
I want to fly but I don't have wings
|
|
|
|
|
System.String and SqlDbType.NVarChar , doesn't work it gives exception.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Hello
I'm currently using SMTP to send mail with attachement from my csharp app
But I also need to let the user add some coments, so the best will be to send the mail via the mail client
I see that mailto: do not allow to sent attachement
I'm looking around Mapi but I do not find any relevant help
Do someone have a suggestion for me ?
Thank you very much
|
|
|
|
|
If you're using SMTP, why can't you simply add a small window to your project where user can add his/hers comments?
|
|
|
|
|
Thank you Mika
But since it might be possible to send using MAPI I want to find out how !
|
|
|
|
|
|
|
I'm already using SMTP !!
|
|
|
|
|
In my application,i have changed the color of text(SyntaxHighLighting), it is working fine,But whenever any one press Ctrl+Z, it undo-operations on my highlighting operations(The most recent operation).
For the solution of this problem:
I have used ClearUndo() but it clears whole undo stack while in the description of this function wrote,clear most recently undo operation.
If you have any solution of this problem,Please suggest().
Can we suspend/Disable/Off Undo or any other way to do the things?
|
|
|
|
|
khaleek wrote: Can we suspend/Disable/Off Undo or any other way to do the things?
Nope - you can't suspend it. What you could do is roll your own undo manager, but this would not be trivial. Alternatively, you can always reapply the syntax highlighting immediately following the undo operation.
|
|
|
|
|
If I have to Undo the Text that was typed just before Syntax Highlight, than we will never able to do the same.
|
|
|
|
|
You will have to re-syntaxhighlight the line, and possibly lines before that. Have fun
|
|
|
|
|
Thanks for your answer.
If we re-Syntaxhighlight the text again than it will gain filled into Undo stack and when any one press
Ctrl+Z it will again undone the operation.
|
|
|
|
|
The point is, that you reapply the highlighting after each undo operation.
|
|
|
|
|
Hi All,
I have set paper size for printer. so i am setting as follows:
e.PageSettings.PaperSize.Height = 850;
e.PageSettings.PaperSize.Width = 1100;
but when i run my application and try to take print out, it gives an Exception like "Paper Size can not be change unless the kind property is set to custom"
can any body please tell how can set this kind property to custom.OR any other method to set page size.
please share your knowledge.
thanks
Bankey
|
|
|
|
|
e.PageSettings.PaperSize.Kind = PaperKind.Custom
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|