|
You're welcome, happy to help
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Is there a way to show busy cursor (revolving or other type) in C# ?
Ex.
Processing Item 1 ...(*) <- flashing cursor
Processing Item 1 ...OK
I have seen this functionality in legacy console application, but don't know how to achieve this.
Many Thanks,
h.
|
|
|
|
|
//start processing
this.Cursor = Cursors.WaitCursor; //this will show the hourglass
//finish processing
this.Cursor = Cursors.Default;
|
|
|
|
|
this.Cursor applies to System.Windows.Forms ?
It does'nt work with System.Console class. If you find any method, please do post another reply.
Thanks for giving it a try.
h.
|
|
|
|
|
I have written some default values in Project Properties -> Settings at user level. I want to access these values in my coding. I am doing "Properties.Settings.Default" but somehow this is giving error.
Even the "Properties" is not recognised by compiler.
Something i missed to include, i don't know what????
How can i read the value from default project settings.
Gajesh
-- modified at 9:34 Wednesday 25th July, 2007
Gajesh
|
|
|
|
|
Hi,
In C# there is property NaN for Double, Single data types to store the null or empty values. If there any such property there for Integer?. I want to know very urgently.
Thanks in Advance.
Regards,
Prakash.A
Good Is Not Good When Better Is Expected
|
|
|
|
|
If you want an integer to be able to be nullable you need to use .net 2.0 where there are nullable types. In C# you can define it as int? The ? after the type makes it a nullable type. So you have have code like this:
int? myInt = null;
if (myInt.HasValue)
{
myInt.Value;
}
Hope that helps.
Ben
|
|
|
|
|
Thanks Ben,
It helped me. My problem has been solved.
Thanks
Prakash.A
|
|
|
|
|
A AntonySP wrote: I want to know very urgently.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
A AntonySP wrote: I want to know very urgently.
Please see this[^] reply.
What have you tried in the way of helping yourself? Did you google for null ints in c#[^]? Knowing how to look for answers yourself is the first step in your journey to becoming a better developer.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
A AntonySP wrote: In C# there is property NaN for Double, Single data types to store the null or empty values
Actually NaN is not intended to be used as depicted above, see
http://msdn2.microsoft.com/en-us/library/system.single.nan(VS.71).aspx[^].
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.
|
|
|
|
|
Excellent point, and I'm kicking myself for missing that one.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Excellent point, and I'm kicking myself for missing that one.
Thank you, I'm proud to receive such a comment by you.
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.
|
|
|
|
|
Finding the properties for an integer is exactly the same as finding the properties for a double.
|
|
|
|
|
How can an integer have properties, as soon
as there is a period it is a double or float
|
|
|
|
|
Can anybody suggest how to convert from pdf to jpeg conversion in ASP.NET?
Please suggest ur views as soon as possible.What's logc behind that.
adil kazmi
|
|
|
|
|
adilkazmi wrote: Can anybody suggest how to convert from pdf to jpeg conversion in ASP.NET?
Yeah, you open up google and do a search ... like this:
http://www.google.co.uk/search?hl=en&q=pdf+to+jpeg+asp.net&meta=[^]
adilkazmi wrote: What's logc behind that.
Yeah I don't know what the logic behind writing
adilkazmi wrote: Please suggest ur views as soon as possible.
is either. People will respond when they can, they arn't getting paid to help you ya know :P
|
|
|
|
|
Yeah I know.
I have just mentioned that it's urgent.It doesn't mean that I am paying anyone.
Is this a way to talk to anyone??
if you or anybody doesn't want to give answers please keep silent.nobody is forcing you to give the answers.
adil kazmi
|
|
|
|
|
You have to understand that there are a lot of posts on the boards where they are urgent or must be done ASAP, etc. The simple fact is, the people on these boards volunteer their time for free and trying to hype something up like this doesn't impress them, or make them want to help any more urgently.
Please read this[^] article, especially the sections headlined "This is not a support forum" and "Replies" to understand why people react this way.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello,
how do I safely invoke a delegate on my windows form if I can't eliminate the possibility that the form gets disposed BETWEEN me checking whether it is disposed and the invoke code itself?
Randomly I'm getting an exception that says I can't access the disposed object. It's absolutely clear that I can't access a disposed object, but how do I make sure it's indeed NOT disposed if it can still get disposed right after I check whether it is disposed?
Consider this example that looks correct, but produces the above mentioned exception from time to time:
if (!MyForm.IsDisposed)
{
MyForm.Invoke(MyDelegate);
}
Form.Disposing doesn't help neither.
Thanks very much for any input,
Michal
-- modified at 7:24 Wednesday 25th July, 2007
|
|
|
|
|
It helps to set a flag that the form is closing and check for that flag before the invoke, but it's not an elegant solution and it might still throw an exception if the flag is set after checking for the flag and the form gets disposed before executing the invoke.
Any ideas?
Thanks,
Michal
|
|
|
|
|
How about wrapping both your protected override void Dispose(bool disposing) -method and your invoke-procedure in a lock(...) -block?
Ref.: http://msdn2.microsoft.com/en-us/library/c5kehkcz(vs.80).aspx
|
|
|
|
|
Cool, thanks a lot! This solutions seems to work.
Next time, I'll be wiser and will use lock for this kind of situation.
Thanks much again!!
Michal
|
|
|
|
|
are you kidding ?
the Dispose() method is the one that typically will be executed by the finalizer thread.
Do you think it will appreciate your lock ?
if the finalizer cant do its job, the GC has less memory to manage and recycle;
do you want the GC to run out of memory for no good reason ?
I am not sure what the right answer is, but what you propose seems very wrong to me.
|
|
|
|
|
Actually, it does not appreciate my lock
If I'm forcing the Dispose() to wait on the lock until all Invokes are done and until I make sure there are no Invokes going to be done in the future, I'm effectively blocking that form's Window Message Queue.
If I'm blocking the Window Message Queue, the Invoke never returns.
Obviously, the same happens (WMQ block => Invoke never returns) if I try, for instance, to block after Form.Closing event etc.
So I'm back at the beginning
Any suggestions?
Thanks,
Michal
|
|
|
|