|
Hi there!
I have here a problem with the X (close) Button.
When I click the button to Exit the application, the form closes but if I see in the windows task manager, the application continues to Run.
What I have to do to end the application process?
Thanks
|
|
|
|
|
Do you start any extra threads while running your applications?
If so, set their IsBackground property true , cause background threads do not prevent a process from terminating. Once all foreground threads belonging to a process have terminated, the common language runtime ends the process by invoking Abort on any background threads that are still alive.
www.troschuetz.de
|
|
|
|
|
oh, I had that problem. all you do is this.
in the properties panel, go to events.
then next to the "closed" event, in the space next to it,
double-click the space. this will allow you to change events that occur when the form closes.
type this:
Application.Exit();
normally, when you just click the "X" button, it simply closes the form, but when you type "ApplicationExit();", it ensures that all forms are closed and the process is ended.
let me know if it worked or not
|
|
|
|
|
oh, I had that problem. all you do is this.
in the properties panel, go to events.
then next to the "closed" event, in the space next to it,
double-click the space. this will allow you to change events that occur when the form closes.
type this:
Application.Exit();
normally, when you just click the "X" button, it simply closes the form, but when you type "ApplicationExit();", it ensures that all forms are closed and the process is ended.
let me know if it worked or not
|
|
|
|
|
oh, I had that problem. all you do is this.
in the properties panel, go to events.
then next to the "closed" event, in the space next to it,
double-click the space. this will allow you to change events that occur when the form closes.
type this:
Application.Exit();
normally, when you just click the "X" button, it simply closes the form, but when you type "ApplicationExit();", it ensures that all forms are closed and the process is ended.
let me know if it worked or not
|
|
|
|
|
whoops. sry about all the replies. don't trust i.e.
use opera
|
|
|
|
|
Just delete all the other ones. That's what the delete link is for.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi ….,
My name is Muhammad Waqas Butt. I was your student in Aptech. I have some problem in winforms.net. I have a project of book store system and old version of this system (software) is DOS base and database in FoxPro. Actually I haven’t work with FoxPro database the thing is now that I want to know that; is there such way that we import data from FoxPro to MS Access 2000, XP or SQL Server 2000? Or can we work with FoxPro database in C#.net and how? Second is that there are many problems in their database mean they enter a single record twice and even more time which makes data so complex. Third is about winforms printpreview control. How can we take preview of datagrid and customize it. Spouse we create a form which have some fields and datagrid control in bottom we have a button for printpreview. If we click on this button a printpreview dialog box open I can jump labels and text boxes value in printpreview but I am fail to jump datagrid on there. And customize it like horizontal lines, alignments of text. So I think you understand my problem and I hope you will help me as soon as possible. And if you have some references regard these problems and .net so please tell about them also I shell me highly thankful to you.
Thanks…
<marquee>Muhammad Waqas Butt
|
|
|
|
|
WaqasButt wrote:
s there such way that we import data from FoxPro to MS Access 2000, XP or SQL Server 2000?
Yes: try DTS, ODBC, ADO or OLEDB providers for DBase, they should work with FoxPro database, IIRC.
WaqasButt wrote:
Or can we work with FoxPro database in C#.net and how?
Yes and no: while it is possible to work with a .DBF DBase database in C#, it'd not be safe to use it while the old application is running - old FoxPro, Clipper and DBase applications often had their own locking schemes - most of them flawed. Touching a database like this should be done with very care...
Yes, even I am blogging now!
|
|
|
|
|
Thanks...Daniel Turini for spending time of my database problem. Now i may be use sql server and make new database. But anyways if you have knowledge about winforms problem or some references or books so please told me about them.
Thanks...
|
|
|
|
|
hi,i am a new bee in this group.
i need the c# code for backpropogation using neural networks in artificial intelligence.sorry for the confusion.if any of u got it then please send mail me.
thanx a lot
kasi malla
|
|
|
|
|
You might want to explain what you mean by "backpropogation", like others have asked you to do in your other post.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello all,
I have created various classes using the XSD.EXE tool provided with VS .NET. In my code I generate various objects based on these class and then serialise them to XML strings.
The problem I have is that when the object is serialised I need all the XML elements to be represented in the string regardless of whether a value is set or not - This works from int values but not string values.
As an example I have the following schema
<xs:element name="schemaRoot">
<xs:complexType>
<xs:sequence>
<xs:element name="testElement">
<xs:complexType>
<xs:sequence>
<xs:element name="intVal1" type="xs:int" nillable="false"/>
<xs:element name="stringVal1" type="xs:string" nillable="false"/>
<xs:element name="stringVal2" type="xs:string" nillable="false"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Which generates XML like this :
<schemaRoot>
<testElement>
<intVal1>0</intVal1>
<stringVal1>String</stringVal1>
<stringVal2>String</stringVal2>
</testElement>
</schemaRoot>
If in my code I do this :
schemaRoot sr = new schemaRoot()
string x = SerialiseToString(sr);
I end up with the following XML :
<schemaRoot>
<testElement>
<intVal1>0</intVal1>
</testElement>
</schemaRoot>
But I need to get
<schemaRoot>
<testElement>
<intVal1>0</intVal1>
<stringVal1></stringVal1>
<stringVal2></stringVal2>
</testElement>
</schemaRoot>
or
<schemaRoot>
<testElement>
<intVal1>0</intVal1>
<stringVal1/>
<stringVal2/>
</testElement>
</schemaRoot>
I am guessing that I need to sets some variable/class attribute in the XSD.EXE generated classes but I am at a loss as to which ones.
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
This is a known limit of the XmlSerializer: you'll need to write your own serialization code for this.
Actually, being picky, people who wrote XmlSerializer are not that wrong, as one should not use empty tags to represent missing information.
BTW, XmlSerializer sucks for everything but the most simple uses (e.g., it does not handle circular references). If possible, try using SoapFormatter. I know, often it's not possible...
Yes, even I am blogging now!
|
|
|
|
|
> Actually, being picky, people who wrote
> XmlSerializer are not that wrong, as one
> should not use empty tags to represent
> missing information.
For the sake of post clarity I ripped out alot of seemingly irrelevant code, one of the parts that got the chop was the minOccurs & maxOccurs attributes for the elements in the schema (both being set to 1)
I would have thought that the Serialiser would have thrown an exception as sending a null value in doesnt conform to the schema the class were generated from.
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
Hi...
How do I identify an unique property of a MenuItem, so that i need to change the text of a menu item for selected menu's only ??
Thanx in advance
saleem
|
|
|
|
|
hello!!!
looked on the net but couldn't find an answer yet....
in c++ i used pointers to hand an array over to a function.
what is the equivalent in c#?
say i want to pass a simple int[].
how does it work with >return<.
so far i declered an array in the class as private, similar to a global variable. however i don't think this is the way forward.
many thanks in advance, Dominik
|
|
|
|
|
Since C# is garbage-collected, you don't need to worry about passing pointers and dealing with memory, like you did in C++: simply pass the array as an argument or return it on a function and the framework will clean it automatically when you're not using it anymore.
See this sample function:
int[] doubleValues(int[] values)
{
int[] retval = new int[values.Length];
for (int i = 0; i < values.Length; i++)
retval[i] = values[i] * 2;
return retval;
}
Yes, even I am blogging now!
|
|
|
|
|
thanks Daniel,
i am already aware of the garbage collection and memory management.
however, is there not a more efficient way to pass arrays to a function???
a pointer takes 4 bytes, whilst my 1k array of a class using doubles takes much more memory.
thanks, Dominik
|
|
|
|
|
dkoder wrote:
however, is there not a more efficient way to pass arrays to a function???
a pointer takes 4 bytes, whilst my 1k array of a class using doubles takes much more memory.
Actually, you're not passing a copy of the array: just like in C++, you're passing a pointer to the array. In C#, everything, but the native types (int, char, double, float, decimal) are pointers under the hood.
Try changing the array inside the function and you'll see that what you're passing is actually a pointer.
Yes, even I am blogging now!
|
|
|
|
|
I want to create an instance of a class, the instance being named by the user at runtime.
So i can put that instance in an arraylist and refer to it by name later (for removing and searching purposes).
Is this possible?(& how?) or am i better off just cycling through the arraylist and searching for the significant identifier in each record. (in this case the Student Number)
Thank you.
|
|
|
|
|
|
Hi. I’m trying to dectypt a string I got from my supplier.
We have a common password and I got a string to decrypt using
System.Security.Cryptography.RijndaelManaged
Here is my decrypt function:
public string DecryptWithRijndael( string Key, string strDecode )<br />
{<br />
<br />
ASCIIEncoding textConverter = new ASCIIEncoding();<br />
RijndaelManaged myRijndael = new RijndaelManaged(); <br />
myRijndael.Mode = CipherMode.ECB;
myRijndael.Padding = PaddingMode.PKCS7;
byte[] key = textConverter.GetBytes(Key);
<br />
myRijndael.Key=key;<br />
myRijndael.GenerateIV();<br />
<br />
byte[] IV = myRijndael.IV;<br />
<br />
byte[] encrypted = Convert.FromBase64String( strDecode );<br />
<br />
ICryptoTransform decryptor = myRijndael.CreateDecryptor(key, IV);<br />
<br />
<br />
MemoryStream msDecrypt = new MemoryStream(encrypted);<br />
CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read);<br />
byte[] fromEncrypt = new byte[encrypted.Length];<br />
<br />
<br />
csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);<br />
<br />
string sDecoded = textConverter.GetString(fromEncrypt);<br />
return sDecoded;<br />
}
On the line:
“csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);”
I got the following message:
An unhandled exception of type 'System.Security.Cryptography.CryptographicException' occurred in mscorlib.dll
Additional information: PKCS7 padding is invalid and cannot be removed.
Any tip on what I may have done wrong… ?
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi,
When I'm coding within a class of form, I can uses MessageBox function, in the new class I have added then what is same function? (the function similar AfxMeaageBox in VC++ 6.0).
Thank,
|
|
|
|
|
You can use MessageBox.Show , but you either need to add using System.Windows.Forms; to the top of your source file, or fully-qualify the class name with the System.Windows.Forms namespace. Your project must also reference the System.Windows.Forms.dll assembly, otherwise it will not compile and you will not see any classes defined in that assembly in the IntelliSense popup. This is true for any classes defined under any namespaces in any assemblies.
It's no different than native DLLs requiring static or dynamic libs in order to link and run, or Java requiring JARs or class files in the CLASSPATH environment variable (or command-line parameter), or VB requiring that an ActiveX control be registered and available on a machine in order to compile and run, etc.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|