|
Can I, at least, configure to what modoule does a cirtin thread belongs to?
|
|
|
|
|
No I dont think so.
AFAIK the managed threads are virtual, i.e. they are not even guaranteed to correspond to
a physical (i.e. a Windows kernel) thread.
This is somewhat illustrated by the fact that managed threads have a ManagedThreadId property,
whose value does not correspond to the kernel's thread IDs; and it has a name, for which
the kernel has no equivalent member at all.
In my experience, there still is a 1-to-1 correspondence between a managed thread and a
kernel thread, but I havent found any way to map them, other than having each managed thread
call some native code to get its own kernel thread ID that is.
Hope this clarifies things a bit.
|
|
|
|
|
I want to have a diagonal Line object as a usercontrol. It can automatic process events as click, drag and drop...Can you help me?
Thank a lot.
QuynhTD
|
|
|
|
|
Hello All,
I need to include a Dialog Box (Visual C++.Net or VC++6 style ) in a Visual C#.Net application at deign time but by default it is Form that is included and you can include by going to Add item.
Please suggest.
Thanks and Regards.
Amar.
|
|
|
|
|
Do you want to include Dialog box which are created in VC++ ? Is it anything like MFC COM (ActiveX) controls ?
|
|
|
|
|
No,
May it be created in C# and generated by the wizard as C# Form is.
Hope this clarifies.
Thanks.
|
|
|
|
|
Hi,
I created a settings file using Visual Studio 2005. The class for the settings file is generated as internal by VS. I need to reach it from another namespace so I want to make it public not internal. Is it good to make a settings file public or does it have any bad effects?
|
|
|
|
|
As it is internal, it's available in the entire assembly, even from a different namespace.
If you need to use the information in another project in the solution, you get a mutual dependency if you access the settings directly. Instead you should send the needed information when calling the method, or creating the object instance, that needs it.
---
single minded; short sighted; long gone;
|
|
|
|
|
I believe the cs file in question is machine generated so its no point making changes to that. Why dont you write your own class which can traverse the settings file using the XML namespace.
try this CP article
http://www.codeproject.com/useritems/SystemConfiguration.asp
|
|
|
|
|
Hi,
I am working on one winform using .NET 1.1. In My form Cancel Button is present. In cancel button code. i am using this.Close() method for closing the form.
if user clicks on top right side X button, Form Closing Event will fires.
how can i find weather a user clicked on Cancel button or X button???
experts any sounds.... ?
regards
GV Ramana
|
|
|
|
|
Hello,
In your CancelButton code (Click event handler), you could set the DialogResult property of the Form to DialogResult.Cancel.
So if the user Closes the Form over the 'X', the Default would be DialogResult.None.
private void CancelButton_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
protected override void OnClosing(CancelEventArgs e)
{
if(this.DialogResult == DialogResult.None)
{
}
else if(this.DialogResult == DialogResult.Cancel)
{
}
base.OnClosing (e);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
I am unable to add OnClosing Event.
Form is having only this.Closing event only
i.e., this.Closing += new System.ComponentModel.CancelEventHandler(From1_Closing);
plz tell me how to add OnClosing Event
regards
GV Ramana
|
|
|
|
|
You are wellcome!
All the best,
Martin
|
|
|
|
|
I am unable to add OnClosing Event.
Form is having only this.Closing event only
i.e., this.Closing += new System.ComponentModel.CancelEventHandler(From1_Closing);
plz tell me how to add OnClosing Event
regards
GV Ramana
|
|
|
|
|
OnClosing is th protected virtual method which fires the Closing event in the base Class (System.Windows.Forms.Form).
As you have your Form derived from Forms.Form, you don't have to handle the Event itselfe, you just can override the method.
Like I did!
All the best,
Martin
|
|
|
|
|
got it. & another problem.
everytime getting DialogResult as Cancel if i click on X button also. how do i get this?
regards
GV Ramana
|
|
|
|
|
Hello,
Now you also want DialogResult.Cancel set, if the user closes with 'X'.
Just set it in the Closing or Closed event.
All the best,
Martin
|
|
|
|
|
Hi Martin,
I dont think it will work your way. Windows already sets DialogResult to Cancel on
hitting the Close box.
This is why: Microsoft intends the Close Button to be identical to a Cancel
action; closing the dialog or pressing Cancel button both indicate "hey, I dont want this,
I am not interested". It is part of the overall GUI conventions that MS came up with.
And, we have had a difference of opinion on this before: one should not go against
such conventions.
|
|
|
|
|
Hello Luc,
Luc Pattyn wrote: I dont think it will work your way
Luc Pattyn wrote: Windows already sets DialogResult to Cancel on
hitting the Close box.
Have you tested it?
I did, with VS2003 .Net1.1!
Luc Pattyn wrote: And, we have had a difference of opinion on this before: one should not go against
such conventions.
Really?
Help me with long-term memory, when was that.
All the best,
Martin
|
|
|
|
|
Martin# wrote: Have you tested it?
Yes.
Martin# wrote: Help me with long-term memory, when was that
IIRC it was about changing the behavior of a group of radio buttons; my point was and is
if it looks like standard controls, it should behave like them too.
|
|
|
|
|
Luc Pattyn wrote: Yes.
So why do we have different results than?
Luc Pattyn wrote: IIRC it was about changing the behavior of a group of radio buttons;
Ahh, now I remember!
Luc Pattyn wrote: my point was and is
if it looks like standard controls, it should behave like them too.
That's also what I think, but I think the point was to modify the behavior in combination with the style.
All the best,
Martin
|
|
|
|
|
Martin# wrote: So why do we have different results than?
I see three possibilities:
- we have different systems
- there is a misunderstanding somewhere
- one of us is wrong (but who then?)
The last post from the OP seems to hint towards the third possibility, doesnt it ?
|
|
|
|
|
Luc Pattyn wrote: we have different systems
XP; VS2003; .Net1.1
Luc Pattyn wrote: there is a misunderstanding somewhere
If I test following code at my Form, it does what I wrote in the comments of the code:
private void CancelButton_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
protected override void OnClosing(CancelEventArgs e)
{
if(this.DialogResult == DialogResult.None)
{
}
else if(this.DialogResult == DialogResult.Cancel)
{
}
base.OnClosing (e);
}
Luc Pattyn wrote: one of us is wrong (but who then?)
It's maybe a lack of self confidence, but I would assume it's me who missed something!
Luc Pattyn wrote: The last post from the OP seems to hint towards the third possibility, doesnt it ?
I haven't understood this one!
All the best,
Martin
|
|
|
|
|
Hi Martin,
the OP posted: "everytime getting DialogResult as Cancel if i click on X button also"
hence he gets DialogResult.Cancel both for the Cancel button and for the Close Box,
so that does not help him.
Maybe/probably the "Close Box implies Cancel result" only applies to dialogs (forms shown with
ShowDialog) where it matters most, and not to regular forms, shown with Show() ?
If so, you probably did the wrong experiment...
|
|
|
|
|
Luc Pattyn wrote: Maybe/probably the "Close Box implies Cancel result" only applies to dialogs (forms shown with
ShowDialog) where it matters most, and not to regular forms, shown with Show() ?
Bingo!
Just tested it!
Luc Pattyn wrote: If so, you probably did the wrong experiment
Did I?
I think he was never speaking of ShowDialog!
But anyway, you found the problem!
Got my '5' for that!
All the best,
Martin
|
|
|
|