|
Either you need to pass this Object of UI to ur server. or create an even in the server class and register it in UI. so whenever server get some message trigger the event, in UI capture the event and print the message using eventarguments.
|
|
|
|
|
When you call new, you create a NEW class instance, and THAT class instance has a delegate attached to it. But it's NOT the instance that is being used by your program. You need to hook the delegate to the instance that is in use. You probably need to read up on what new does and what a class instance is, or at least how they relate to delegates ( a delegate gets hooked to one instance, not to all instances automatically )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
How to read a single element in DataGrid ?
Thanks in advance
|
|
|
|
|
try out
datagrid1[rowindex,columnindex].ToString();
rahul
|
|
|
|
|
How do I view a 2 pictures in 2 different windows at the same time?
tony-yeyo
|
|
|
|
|
place a picturebox on each window and use the "Image" property to select your picture.
All the best
Martin
|
|
|
|
|
Make them modeless ( show instead of showdialog ) so they are both responsive. More detailed info than what you've been given in the two responses you have would require more info about your situation.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have done a project in .net. I want that when a user tries to run the .exe, if it is already running then the same instance should be focused and no new instance should be creaed.
what to do please let me know
|
|
|
|
|
check out this code
string aModuleName = system.Diagnostics.Process.GetCurrentProcess.MainModule.ModuleName;
string aProcName = System.IO.Path.GetFileNameWithoutExtension(aModuleName);
if (system.Diagnostics.Process.GetProcessesByName(aProcName).Length>1)
{
Application.Exit();
}
Navin
|
|
|
|
|
You can use a Mutex. Here is a piece of code that shows how to do it:
In program.cs:
<pre>
private static System.Threading.Mutex _mutex;
private const string _mutexName = "Company_Product_MUTEX";
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//Allow only one instance for this app to be active
try
{
//try to open existing mutex
_mutex = System.Threading.Mutex.OpenExisting(_mutexName);
if (_mutex != null)
return; //exit program;
}
catch
{ //There was no existing mutex so create mutex
try
{
_mutex = new System.Threading.Mutex(true, _mutexName);
}
catch { };
}
Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
/// do rest of the code, like Application.Run() etc.
}
static void Application_ApplicationExit(object sender, EventArgs e)
{
//Release Mutex
if (_mutex != null)
{
_mutex.ReleaseMutex();
}
}
</pre>
That should do the trick.
|
|
|
|
|
Create a Mutex in the very first instance and if it already exists, then just quit your application. Some pseudocode:
if(!Mutex.Exists("SomeName"))
{
Mutex.Create("SomeName");
}
else
{
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Single Instance[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
hi
i want to access the serial port to send or read data from that.
in this case i want to use Win API in my application.
my application is written in C#.net and .Net frame work version is 1.1
in this version the namespace SerialPort is not worked.
thatway i want use Win API's to communicate the serial ports.
and also list of Win API which are useful to communicates the serial ports in C#.Net
or any one can send some example programs the serial ports in c#.
plz help
G.Prem Kamal
|
|
|
|
|
You could download Reflector, search for the SerialPort class, and check (or copy / paste) the work Microsoft has done on the new class.
|
|
|
|
|
What's wrong with the answers you got below ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
They weren't serfed up on a golden platter.
|
|
|
|
|
I want to implement a chess game in C# and make it interoperable in J2EE too.
|
|
|
|
|
I look forward to reading your CP article. It will be interesting to say the least. J2EE is a web framework, and Java is a different language. How do you hope to achieve it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to write some Program which can control the behavior of Windows, things like Disabling Ctrl+Alt+Delete, hiding start menu. this stuff
so anyone can help me in this, or tell me where shall i start searching
|
|
|
|
|
This article has some cool stuff: Lock Windows Desktop[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thank u, ur code exactely satisfy my needs, but i want to do this under .NET not in visual c++
|
|
|
|
|
I m trying to export data in excel sheet, Data are exported in excel perfectly but i have a price filed in it which will truncated by excel to the non zero digits, but i want to show price field upto 4 decimal places either zero comes after decimal. Data are export through store procedure, size of price is defined 4 decimal places in sp but still excel trucate it to the non zero digits, what should i do to resolve this issue.
Regards,
Raheel Iqbal
|
|
|
|
|
Either change the cell or column formatting to text,
or add a single quote to the cell before the number: '9432.5700
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
can anybody help me in developing an application like VNC(virtual network computing) in c#
prashanth
|
|
|
|
|
The question is very vague, but if you want an answer to it, the answer is no.
Anybody can't help you with that, as everybody doesn't have the knowledge required to contribute anything to the project. I am sure that somebody can help you, though.
If you want a more specific answer than that, you have to write a more specific question.
---
b { font-weight: normal; }
|
|
|
|