|
One way to do this would be using the Action tag.
Have a look here[^].Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Delegates are not equivalent when they just share the same signature, you could do this if you declare only one delegate type and use that in both places.
Delegate declarations do not have to be inside a class.
|
|
|
|
|
I want make a application that prints repports.
what is the best method to put data in word or modify word document?
from c# --> xml --> word or
c# --> word
or a another method?
|
|
|
|
|
|
double myVal = Math.Pow(10, 38);
txtResult.Text = String.Format("{0:n}", myVal);
double myVal = Math.Pow(10, 38) - 1;
txtResult.Text = String.Format("{0:n}", myVal);
Both of theme result is same;
100.000.000.000.000.000.000.000.000.000.000.000.000,00
But first example formula contain "-1"
|
|
|
|
|
This is a 'feature' of floating point numbers which are generally an approxmation of their integer values. While you can hold much larger (and smaller) values in double or float , you lose precision as a consequence. Refer to this article[^] for details. If you want large numbers with accuracy then you need to use BigInt or similar.MVP 2010 - are they mad?
|
|
|
|
|
That is because your myVal exceds the maximum value representable by a double(without the scientific notation).
If you use it with a smaller number => ok.
try using a decimal number and you'll see that it will thorw an exception(value too large).
Your value is actually 1.0E +38
|
|
|
|
|
Hi Guys,
I am writing an application where i need to log errors and some information,so for this i have written a class that is working perfectly fine when in debug and in re;ease mode but when i am making an exe and trying same application logs have not been written.
am using
string baseDir = AppDomain.CurrentDomain.BaseDirectory +
AppDomain.CurrentDomain.RelativeSearchPath;
to retrive the directory location...
can you guide me where i am lost.
Thanks
Vikasvikas da
|
|
|
|
|
Can u write down or Upload this class !
So we can see where is the problem ?
|
|
|
|
|
Hi,
check the value of baseDir;
does it end on a backslash?
does the folder exist?
can you create a file there?
why don't you use Environment.GetSpecialFolder? ApplicationData is probably what you want.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Hi Luc,
while debugging i have checked the following
check the value of baseDir;
it comes with right path
does it end on a backslash?
yes it end with \\
does the folder exist?
yes the folder exist and it none but the base directory of my code path
can you create a file there?
yes files created there when running in debug or release mode
but when ever i am making an exe and installing it to another system files are not created.vikas da
|
|
|
|
|
You could try:
Application.StartupPath
The only difference is in the "\" so
Application.StartupPath => "C:\Data\Blah"
and
AppDomain.CurrentDomain.BaseDirectory => "C:\Data\Blah\"
As for the AppDomain.CurrentDomain.RelativeSearchPath :
if you do not create it specifically in code something like this:
domain.AppendPrivatePath("MyCustomAssembly");
it will return empty string.
|
|
|
|
|
tasumisra wrote: ,so for this i have written a class
Why reinvent the wheel? There are plenty good frameworks for this already like, Enterprise Library, whose pupose is to create a library of common tasks to save developers from having to recreate it each time. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I open and hide form using form.showdialog() and form.hide();
How do i detect if the current form is hidden, and if it's hidden don't do this.modified on Sunday, February 7, 2010 8:41 AM
|
|
|
|
|
To hide the form use the Form.Hide method. To show it again use Form.Show
Simple, no?If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
hey OriginalGriff,
Tks for the reply. i have edited my question to make it more clear.
I open and hide my form using form.show and form.hide
how do i check if the current form is hidden so as not to perform certain task
|
|
|
|
|
The property form.Visible determines whether a form is visible (shown).Greetings - Jacek
|
|
|
|
|
Great. It works. tks Jacek
|
|
|
|
|
you can put global bool var. and when you hide the form put it True else false
(it is just an idea)
|
|
|
|
|
Tks. alternative idea for visible method.
|
|
|
|
|
this how i hide a form and open a new one
Form1 form = new Form1();
this.Visible = false;
if(form.ShowDialog() == DialogResult.OK)
{
}
this.Visible = true; / on close of the form you opened the one you started from shows

|
|
|
|
|
Dear Experts!
I am using xml in my project to store a list of objects of different types derived from the same base object.
[XmlArray("parts"), XmlArrayItem("part", typeof(Cpart))]
public ArrayList parts;
This approach works only if all objects are of the same type.
Can it be dome with objects of different types in the array?
Thanks!modified on Tuesday, February 9, 2010 4:43 AM
|
|
|
|
|
I want to fill a combobox with System.Windows.Forms.Keys Emun!
So how can i do that?
|
|
|
|
|
You can fill combo box like this
comboBox1.DataSource = Enum.GetNames(typeof(System.Windows.Forms.Keys));-----------------------------
Shakeel Iqbal
------------------------------
My New Article
Task Manager
|
|
|
|
|
Hi,
What's the equivalent of final keyword(Java) in C# ?
Thanks.
|
|
|
|