|
As you might know, the .NET Compact Framework is a minimized version of the normal .NET framework, enough stuff has been cut out in order to be able to run smoothly on devices with low mem.
The problem I am facing right now:
How can I ensure only 1 instance of my application is running? Named mutexes are not supported in .NET Compact Framework, so I have to find another way, that`s still safe.
Thanks for any help you can give,
Davy
|
|
|
|
|
i have a 500 by 400 form and with a statusstrip + 2 statusstriplabels on it.
set time on a statusstriplabel. everything works fine till now.
but if i resize my form. (statusstriplabel's) times' place remain the same.
any place in form can be replaced with dock or anchor support.
but if i use anchor for statusstrip, its place changes.
comes somewhere in form
i want it at bottom but it should be able to size itself according to form's size...
how can i do this ?
|
|
|
|
|
Leave the StatusStrip docked at the bottom. Set the Spring property of the left StatusLabel to true , and it will fill up the space in the StatusStrip and keep the right StatusLabel at the right end of the strip.
--
I've killed again, haven't I?
|
|
|
|
|
hi all,
let's say i have a few texboxes and a 'submit' button. how i enable enter key always active on that button ?
i mean if i have 3 texboxes and a submit button: pressing 4 times on TAB key, submit button will be active. (pressable)
anytime i hit enter, i want to activate my submit button ¿
thanks in advance.
|
|
|
|
|
u can try on textbox's keypress event following code
if(Convert.ToInt16(e.KeyChar)==13)
button1.PerformClick();
rahul
|
|
|
|
|
check the AcceptButton property of ur form and select the button wich u want to b pressed on the enter key
i hope this will help
Regards,
|
|
|
|
|
As MSDN's docs say, Thread.Abort() throws an exception in the corresponding thread:
"Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread."
Does it mean that I have to catch the exception, and perform an aborting routine?
Or perhaps I should leave the exception, and expect it to just terminate?
Thanks,
Shy.
|
|
|
|
|
Not handling it will result in an unhandled exception in your application which might result in a crash (or that nasty dialog coming from .Net).
Catching it an gracefully clearing up resources/doing cleanups is the way to go.
|
|
|
|
|
You can catch the ThreadAbortException in the thread if you want to make it aware of that it is being aborted.
There are three ways of keeping the thread from being aborted:
:: Go into an eternal loop after catching the exception to keep from exiting the catch block, as exiting the catch block automatically raises the exception again.
:: Go into an eternal loop in a finally block, as all pending finally blocks are executed before the thread is killed.
:: Call Thread.ResetAbort after catching the exception to cancel the abort. This is of course the preferred method if the intention really is to keep the thread alive.
In any other case, the thread will be aborted.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Can any one tell me how to convert the below code to c#
Int *ptr;
ptr=&array[0];
sum = avg(ptr,index)
I know that we can use ref key word but how do i assign the address to ptr?
|
|
|
|
|
Hello Folks,
I am wondering if I can start a second application from a first one, something like shell execute but on Win CE.
I use C# on Win CE and try to write something like a bootloader. The bootloader starts and checks a few things and then should launch another application.
Does somebody know how to d that?
Thanks a lot,
Marco
|
|
|
|
|
u can try
System.Diagnostics.Process.Start(compelete path of application to run);
rahul
|
|
|
|
|
Thanks Rahul,
unfortunately for whatever reason I don't have the namespace Process under System.Diagnostics ...
Anyway lots of thanks for your help!
Marco
|
|
|
|
|
You can use the native calls ShellExecute or CreateProcess by using dllimport
In the class you wish to start another app use the following namespace
using System.Runtime.InteropServices;
then define from which dll to get the function and the function name with dllimport and on the immediately next line define the function with all the parameters
<br />
[DLLImport("Coredll.dll", EntryPoint="TheFunctin")]<br />
public static extern void TheFunction(... all your params...);<br />
In the above example replace the TheFunctin with the actuall function name you wish to import (in your case CreateProcess or ShellExecute, and replace the ...all your params... part with correct parameters -> depends on which function you^ll use...
I think CreateProcess is in the Coredll.dll lib and ShellExecute is in the CeShell.dll, but you`ll have to doublecheck that.
Friendly Regards,
Davy
|
|
|
|
|
Davy,
thanks a lot for your help!
I'm not quite familiar with the dll-import but I guess I'll figure that out.
Best regards,
Marco
|
|
|
|
|
Hi,
I've created a control which has a string field, accessed through a bindable property.
However, when the control is in a form, and the bindingsource has a null value in the binded property, the value of the string is never updated.
I've tried using the advanced databinding properties to set an empty string when the incoming value is null, but no luck so far.
Any ideas? thanks in advance
|
|
|
|
|
I hane an application where one of my dialogs is created when the program starts. I like to call Form.Show() and Form.Hide() to show and hide the form.
When the user presses the system-X button the form is per default disposed. How do I prevent that I just want a Form.Hide() when the user does that so that I can call Form.Show() again without making a new instance of it.
_____________________________
...and justice for all
APe
|
|
|
|
|
Handle the Closing event on the form and cancel the operation (see the event arguments, e ). You can then hide the form instead.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Perfect Thanks!!
protected override void OnClosing(CancelEventArgs e)<br />
{<br />
e.Cancel = true; <br />
Hide();<br />
}
_____________________________
...and justice for all
APe
|
|
|
|
|
Hello community.
I have a problem and cannot solve it:
How can I measure the query execution time from my C# application?
I need to get a number or a time class to my app. from my database server, but
not measure the time when I got the informations from db but the internal time in db server. So I will display something like "Execution time: 0.0015 ms" in Sybase Interacive SQL.
I'm using Adatptive Server Anywhere v8 and v9
thanx lot
|
|
|
|
|
Try using the preformance counter: [^]
|
|
|
|
|
How does one highlight or de-highlight an item in a listview programmatically
|
|
|
|
|
you can use
listView1.Items[rownumber].Selected=true;
listView1.Select();
rahul
|
|
|
|
|
int index = //your index
listView1.SelectedIndex = index;
|
|
|
|
|
Hi Folks,
I am opening a Folder Browser Dialog. It opens with a help button which I dont want. Any idea how to remove Help Button from this dialog.
Thanks in advance.
|
|
|
|