|
You are quite welcome.
Personally, I'm not really hot about .NET being the best way to get such jobs done. If you're changing tools, C++ is a really stable career move. Whether it would work best for what you're doing depends on what you're doing -- but frankly, there isn't much that C++ isn't superior for (even if C# is a great step ahead in certain areas such as header-free development).
In any case, your project touches on a number of things I have to do rather regularly. Stress generics (no matter the development tool). Go light with your resource footprint. Much is said here about certain C# drawing techniques (or technologies) being slow, but you can get around that, particularly with double buffering. The usual requisite approach is to draw off-screen first -- then iterate your generic list to get the job done.
|
|
|
|
|
Hello..
Example:
there are 2 textbox, where i'll type a numeric value
this is the value in the first 2 textbox,
textBox1=500
textBox2=1000
then in textBox3 the sum of the 2 values in the textbox should be automatically generated without triggering it with a button.
Example, i just finish typing those numbers and when i'll press tab in my keyboard,
texBox3 should display=1500
how will i code it?
thanks.
|
|
|
|
|
private void textBox2_Leave(object sender, System.EventArgs e)
{
textBox3 = Convert.ToString( Convert.ToInt64(textBox1.Text)+Convert.ToInt64( textBox2.Text));
}
rahul
|
|
|
|
|
The above function is not a correct one... It ll give an error "Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'".
To correct that,
assign the converted string to the textbox3's text.
textBox3.Text = Convert.ToString( Convert.ToInt64(textBox1.Text)+Convert.ToInt64( textBox2.Text));
Thanks & Rgds,
Sri..
|
|
|
|
|
That is just a question of common sense
rahul
|
|
|
|
|
I have a class which descends from Control and features a Bitmap property. It is my impression that it is my control's responsibility to call Dispose() on the example f_BitmapField in the commented out call of the following snippet. If I deploy this call (remove the comment instructions), there is no resource issue at run time destruction, but if this control is placed on a parent control, then when I delete the parent control at design time (without first deleting my child control) I get an ambiguous error stating only that a parameter is invalid. A later dialog is sometimes raised which refers to the property, not the field — suggesting that an invalid reference to the property exists. No Finalize method is deployed, and no further dispose processes refer to the field or resources which can be associated with it at disposal.
Can anybody explain this behavior? Is it not theoretically the control's responsibility to call Dispose() on the bitmap field as in the commented lines here?
I am beginning to wonder if the IDE isn't mishandling the proper implementation — forcing me to write the wrong code (omit dispose) so that I get acceptable design time behavior. Run time behavior doesn't seem to be affected. I don't feel comfortable about the required implementation. Maybe someone knows there is a different, explicit pattern to follow here?
protected override void Dispose( bool disposing )
{
if ( disposing )
{
}
base.Dispose( disposing );
}
|
|
|
|
|
I'm new to learning C# and I don't know what all the error messages mean. Yet. Can somebody give me a clue as to what the following means. And maybe what I need to do to fix it. Thanks in advance for any information.
"An object reference is required for the nonstatic field, method, or property"
|
|
|
|
|
This message means that u r tying to initialize any method or property of a class
with out creating its object u r trying to access it directly through that class
but that class is non static.It is only possible for static class to access its
public methods and property directly with out creating any object.
rahul
|
|
|
|
|
Hey,
I have to compresse 70MB of data in a C# application and I have to mail them automaticaly back to our server. So I have to compresse them in 7 files of 10MB. Is there any way I can do this in c#? I looked everywhere but it's always 1 .zip file you can make
I thank you for your time!
olivier
|
|
|
|
|
|
Hi, .net lets you make as many zips as you want:
http://msdn.microsoft.com/msdnmag/issues/03/06/ZipCompression/default.aspx
|
|
|
|
|
HI,
In C# how do you compare 2 struct's?
Thanks,
Liam
|
|
|
|
|
firstStruct.Equals(secondStruct)
|
|
|
|
|
I guess that depends on how you're going to use them and if the structs are the same type. The IComparer interface is what you'd want to use if you didn't have control of the structs and you were trying to sort them in a list (for example). You could also implement the IComparable interface on the struct if you have control over them.
|
|
|
|
|
You should not use Equals if you want to compare for true equality, because Equals only checks if the compared values refer to the same instance. To determine true equality of value you have to compare the fields. See Richter for further information. The base implementation actually compares for identity, not equality.
|
|
|
|
|
Hi,
I have a table displayed in a datagrid.
If I select a cell, that row has to be populated in the text boxes that I have.
I am unable to refer to the individual fields in the row, of the cell that I clicked.
For EG: If i select any cell in row 10 all the columns in row 10 has to be populated in the text boxes that I have.
Can you please tell me how to refer to the cells in the row that I have selected.
An example code will be very very helpful.
Thanks,Arun
|
|
|
|
|
Try something like this:
DataGridCell dgCell = dataGrid.CurrentCell;
textBox.Text = dataGrid[dgCell.RowNumber, dgCell.ColumnNumber].ToString();
|
|
|
|
|
Hi,
I am trying to find out if there is some function to validate whether a user entered an integer. All suggestions welcome. Thanks.
|
|
|
|
|
Entered an integer into what? A web for then I would suggest javascript validation isNumber (or is it isNumeric I really don't remember) or even the regular expressions.
If it is server side just TryParse.Int32. Also, various styles of input text boxes exist which can automagically restrict input.
File Not Found
|
|
|
|
|
Here are a couple of ideas:
1. You could mask the input and only allow digits:
protected override void OnKeyPress(KeyPressEventArgs e)
{
base.OnKeyPress(e);
if (char.IsDigit(e.KeyChar) == false)
{
MessageBox.Show("Invalid Input...");
}
...
}
Of course you would also have to handle the user entering text without pressing a key (a paste operation for example).
2. You can attempt to convert the value when the user is finished:
protected override void OnLostFocus(EventArgs e)
{
base.OnLostFocus(e);
int number;
bool isNumber = int32.TryParse(textbox1.Text, out number);
if(isNumber == true)
// Do something
else
MessageBox.Show("Invalid Input...");
...
}
}
Ian
|
|
|
|
|
When testing one of my programs i got a Loader Lock Message from VIsual Studio 2005:
LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
I did some testing and it occurs whenever I press a key on a program i am testing, even if there is only a form and nothing else. How should I fix this problem? I need this fixed to test my program. Thanks.
|
|
|
|
|
The loader lock detection isn't an actual exception; it's a Visual Studio "debugging assistant" that helps you track down bad practices, leaks, and other workin's of the devil.
First of all, make sure this is valid: are you doing any unmanaged interop during initialization? If so, this error may be valid and you should fix it.
If this isn't a valid error, fortunately for this scenario, you can disable this debugging assistant: Debug->Exceptions->Managed Debugging Assistants->Loader Lock. Uncheck the "thrown" box, and you won't see this error any more.
|
|
|
|
|
Thanks.
I'm definately not doing any unmanaged interop, I'm using the code the designer made for me, and it has an error with its own code. So I will turn it off.
|
|
|
|
|
HI
I wanted an anti-virus software to which i can provide files and get resuts programatically.
Any AV software that give SDKs or some sort of API's
Thank you!
|
|
|
|
|
Is open source.
File Not Found
|
|
|
|