|
I m not asking for ASP.NET . I am asking for Windows Form.
I am not creating application for webdevlopment its basically an Windows Application. over there I have to use datagrid with nested or master child relation.
KHATRI
|
|
|
|
|
Hi,
I want to baind only images(.bmp, gif, jpeg, etc) in combobox...Can any one help me on this..
Regards,
Sivaprasad
|
|
|
|
|
I need to send WM_COPYATA to another process from a C# program. Is there a C# method (maybe a class) equivalent to the Win32 API SendMessage(HWND h, ...) ?
|
|
|
|
|
MSDN[^]Article will help you.
Regards,
Satips.
|
|
|
|
|
Thanks , Satips.
|
|
|
|
|
Thanks, Satips, but in fact it didn't help me. I'm converting a working MFC program to C# and the only thing I stuck on is sending WM_COPYDATA message to another process, and the article doesn't say which method or class I should use (maybe I should use interop ?). Thanks anyway.
|
|
|
|
|
You could simply use P/Invoke SendMessage using this[^] p/invoke declaration. To get the window handle of the other process, you can use Process.GetProcess to get the process object for the other process and then use the MainWindowHandle property to get the window handle.
You would also need to use the actual value of WM_COPYDATA (0x004A), as that enum doesn't exist in C#.
|
|
|
|
|
Thanks Senthil, I got it.
|
|
|
|
|
Hi
I would appreciate if somebody help me,because i m beginer in C#.
1)The property of my main form IsMdiContainer=True .I would like to change its color to white but I can not.
2)In my main form I add to buttom that when I press the first button the second form will show.but the buttoms also will show else I want them never shown when the second form is active.
thanks
|
|
|
|
|
hi
i create a windows application and i change main() method to following code :
(add parameter)
static void Main(string param1)<br />
{ <br />
System.Diagnostics.Process.Start(param1);<br />
<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
Application.Run(new Form1());<br />
}
but the following error shown me :
Error 2 Program 'C:\Documents and Settings\Hamed\My Documents\Visual Studio 2005\Projects\ExeControl\ExeControl\obj\Debug\ExeControl.exe' does not contain a static 'Main' method suitable for an entry point ExeControl
how to solve my problem ?
thanks
|
|
|
|
|
Try
static void Main(string[] args);
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
thanks dnh.
my problem was solved
|
|
|
|
|
So, why did you change the signature of the Main method in the first place?
|
|
|
|
|
I've been trying to extend the functionality of the "file property" page in Windows.
All I've come up with after an hours worth of searching is a possibility to ADD a new tab to the dialog (property sheet handlers).
What I'd want to do is to add some checkboxes and perhaps some other elements to the default property page tab. I know it has to be possible since I've seen one application doing just that.
I hope someone here can help me find a way to accomplish this.
thx
Ele
|
|
|
|
|
Hello everyone,
I am having some problem adding ContextMenu Control and I was wondering if I can get some help.
I have a ListView "listView1" which I am trying to add a menu once the right mouse click is clicked. I have added a ContextMenu control to the Form "contextMenuListView1" and have added three items to it.
I understand in order to activate this functionality I need to associate the context menu with the listView control on the form. Unfortunatly, I don't know where I can do it! I am looking into properties of the listView control but I am not seeing anything relevent.
Can someone be kind enough to tell me how this can be done?
Thank you for your help and have a great day.
Khoramdin
-- modified at 17:46 Sunday 8th April, 2007
|
|
|
|
|
Hi,
Khoramdin wrote: I am getting error
compile-time error ? read the error message and fix it
run-time error ? read the error message and fix it
cant find a solution ? publish the error message and someone will find a fix.
|
|
|
|
|
Hello All,
I'm looking to use the System.IO.FileSystemWatcher to watch a directory for changes. And then writes all these changes to the console for the life time of the applictaion.
Looking at the MSDN site i was able to sucessfully use this object to check for a change
(which it did fine for the first change).
So then i thought that i could get the object to check the folder periodically by putting the code in a loop and using Thread.Sleep to act as a timer.
here's something like the code :
<br />
FileSystemWatcher wa = new FileSystemWatcher(); <br />
<br />
try<br />
{<br />
int i = 0; <br />
wa.Path = "C:\\New Folder";<br />
wa.Renamed += new RenamedEventHandler(wa_Renamed);<br />
wa.EnableRaisingEvents = true; <br />
<br />
do<br />
{ <br />
System.Threading.Thread.Sleep(5000);<br />
Console.WriteLine("Checking....."); <br />
i++;<br />
}while(i <= 10);<br />
<br />
Console.WriteLine("Press \'q\' to exit");<br />
while (Console.Read() != 'q');<br />
The problem is that(at least as it seems to me) once the event _Renamed has been fired it won't fire again. Eventhough the loop is going on.
Btw if you haven't noticed i'm new to C# and to these boards. So, HI.
Thanks for any help or shoving in the right direction.
N/A
|
|
|
|
|
Dag Ylno,
your while loop lasts for some 50 seconds; during tht time the thread running it
is blocked; if it happens to be the UI thread, then other events will be suppressed
during that time. In fact it is a bad idea to execute Thread.Sleep() on the UI thread.
The FileSystemWatcher is firing events when requested to do so. So the real work
should occur in methods such as wa_Renamed.
If you want to periodically inform the user that your program is running, I suggest
you use a Windows.Forms.Timer to do that; it does not require Thread.Sleep(), it
simply calls a user supplied method (the "tick handler") either once or periodically,
executing it on the UI thread, hence not wasting any resources and not blocking
other events.
Hope this helps.
|
|
|
|
|
Thanks for the reply Luc.
I got the thing to work in the end. I just needed to do the following(disable and then re-enable:
<br />
private static void WatchFolder(ref FileSystemWatcher wa)<br />
{<br />
Console.WriteLine("Checking..........");<br />
wa.EnableRaisingEvents = false;<br />
wa.EnableRaisingEvents = true;<br />
}<br />
You were saying in your reply that instead of using the Sleep function i should use the Timer. Could you post a very simple piece of code to show how to use the timer to call a method at a specified time or interval?
Thanks again.
|
|
|
|
|
Hi, I am using a simple forms timer in my Sokoban article.
CORRECTION: Sokoban uses a Thread, not a Timer.
Here is some example code that causes a timer to fire 100 times
(although a period of 1 msec is specified, it will actually be much slower,
see my timers article if you're interested):
public class CPTest_FastTimer {
System.Windows.Forms.Timer timer=new System.Windows.Forms.Timer();
int count=0;
DateTime start;
public void Run() {
start=DateTime.Now;
log("start = "+start.ToString("HH:mm:ss.fff"));
timer.Interval=1;
timer.Tick+=new EventHandler(timer_Tick);
timer.Start();
}
private void timer_Tick(object sender, EventArgs e) {
count++;
if (count>=100) {
log("got "+count+" ticks between "+start.ToString("HH:mm:ss.fff")+
" and "+DateTime.Now.ToString("HH:mm:ss.fff"));
timer.Stop();
}
}
}
-- modified at 20:34 Sunday 8th April, 2007
|
|
|
|
|
I'm looking for a C# function
string NumberToWords( Decimal d )
which returns amount by words, e.q.
NumberToText(100m) should return one hundred.
How to implement this ?
Andrus
|
|
|
|
|
|
This article[^] will show you how to implement what you ask for. It will also demonstrate how you can do that sort of thing for yourself in the future, too.
|
|
|
|
|
hi guys
i want to handle exceptions on dot net remoting , i want to handle exceptions in my client thrown by remoting server , any way ?
thanks in advance
hello
|
|
|
|
|
try/catch
only two letters away from being an asset
|
|
|
|