|
The TextBox isn't updated cause the loop you're talking about probably runs on the main UI thread and therefor no other messages (e.g. change text of textbox) are processed until it is done. They are queued in the message pump and get executed after the event handler finishes. Take a look at the Control.Refresh method that forces a visual control to redraw itself immediately.
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi Stefen,
Thanks for that. I swear I was looking for a Refresh method, but couldn't find it!. LOL. It worked anyway. Thanks!
Tony
|
|
|
|
|
Gonna bump this as I'm still having the problem!
Tony
|
|
|
|
|
Hi,
Could you please help me to add status bar buttons to the ApplicationMenu in DevExpress. Example button: Word 2007 exit button in Application Menu.
Thanks,
John
|
|
|
|
|
Your best bet is to review the help/samples that came with the product. Then, if that doesn't work, have a look at the support forums on the DevExpress website.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
|
I need to know that return parameters of SetSystemTime function (that has been located coredll.dll of windows ce 5.0 device) usually returns 1 return type uint. but sometimes i cannot set device time. Is there any idea ?
thanks to all
|
|
|
|
|
|
I have the same problem. The marshal tells me that error 57
Have you managed to solve it?
CE 5.0
c# CF 2
|
|
|
|
|
i think i solve it
it was so before...
codes at home let me check @ home and send it
|
|
|
|
|
Which are the settings in web.config file for sending the Emails thr' SMTP?
Sarika Wake
|
|
|
|
|
using System.Net.Mail;
...
SmtpClient smtpClient = new SmtpClient("smtp.myisp.com");
smtpClient.Send("tome@me.com",
"fromyou@you.com",
"Hello Word",
"This is the message");
Also look at the MailMessage class to add more functionality to the send.
You don't need to do anything to web.config.
|
|
|
|
|
I am developing an application in c#,I have to select a file from PC and upload the file details to server.The file details incude filename,filetype,size etc.
In order to find filetype I need to detect MIMEType.
Please anybody help me.
Thanks
|
|
|
|
|
Maybe this[^] is of some help for you.
SkyWalker
|
|
|
|
|
Hello,
I am having few queries related to "reference" and "const" in C#.
1). How to pass a const value by reference.
i.e. in C++
Class Vehicle{};
AnotherClass
{
Vehicle vh;
void SetData(const Vehicle& );
}
How to do it in C#.
2). How to use const member function in C#.
Thanks in advance.
Gajesh
Pune(India)
|
|
|
|
|
C# is crap. You can't do either.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
John Simmons, stop hijaking Christian's account!
led mike
|
|
|
|
|
gajesh wrote: How to pass a const value by reference.
What you are asking for is either very simple or not possible at all, I haven't tried which. You can try it:
const int answer = 42;
SetData(ref answer);
void SetData(ref parameter) { ... }
This will either automatically create a copy of the constant before it's passed to the method, as a constant can not be changed, or it will produce a compilation error, as you have to copy the value yourself.
What it looks like you are trying to do from the code, is to make a constant argument, which is not supported in C#.
gajesh wrote: How to use const member function in C#.
Methods are always constant, you can never change the definition of a method at runtime.
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: Methods are always constant, you can never change the definition of a method at runtime.
AFAIK C++ const methods are, by definition, methods that can't change the state of the object they belongs.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
or a way to create a string-indexed array of int (sort of the reverse of what most arrays are)... thanks!
|
|
|
|
|
Dictionary is a map. In .NET 2.0, generics means you can specify the type of the two arguments.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Talking about the designers of C# making something complicated or what!
I have built a LogViewer application and my objective is to terminate the application if it determines there are no log files to display or if the logfile is in use by another application.
I run the application from Main as follows:
Application.Run(new MainForm());
In MainForm, it first does InitializeComponent, then it Populates the LogSelector with some user choices and then it adds logging info to the appropriate control if a log file is available (DisplayLogInfo).
If DisplayLogInfo detects that no logfile is available or the logfile is being used by another app, I want LogViewer to not show any form and to terminate.
I have tried this.Hide(). I have tried Application.Exit(). I have tried to make the form invisible by setting this.Visible to false. I have tried this.Dispose(), but then I get an unhandled exception and would rather not handle the exception by ignoring it.
Regardless, the form always displays and I have to close the app via closing the Window by the Close button.
Can anyone suggest a way to get this to work.
I would rather not rewrite the app. so that it checks for the logfile before running InitializeComponent as I believe there must be a way to accomplish the task as I have written it and I would like to learn how it can be done.
Comments?
|
|
|
|
|
Add a handler for MainForm's Load event, and execute this.Close() inside that handler. E.g.:
private void MainForm_Load(object sender, System.EventArgs e)
{
if (LogFileIsNotAvailable)
{
this.Close();
}
}
|
|
|
|
|
I see that your suggestion should work; however, I am still a little puzzled.
Can you tell me the reason why the "this.Hide()" or "this.Close()" did not work when implemented within the MainForm constructor?
|
|
|
|