|
Perhaps you should get rid of this moosebdc program. Personally I don't like apps that close other things without my consent.
|
|
|
|
|
I want to format color for some specific rows that meet a certain conditon (for example last 5 rows) in DataGrid.NET, how will I do?
the same question for CheckedListBox, I want to format color for some specific item.
thanks.
|
|
|
|
|
I had realized a movable label control on windform, now I want it resizable look like the text label in PowerPoint,how to do it?
Thanks!
|
|
|
|
|
We are looking at buying a grid control, but I thought I'd see if our two issues are solvable with the DataGrid in .NET...
1. We need an event to fire when the user's selection of row/rows changes (when the user uses mouse and arrow keys). DataGrid does not support this natively, but is there some way to accomplish it?
2. The center horizontal alignment of column header text does not work but left and right do (documented MS bug); it centers all cells but not the column caption text. Is there a work-around to accomplish centering of the column header captions?
I am still using .NET Framework 1.0 if that matters.
Thanks,
Jason
|
|
|
|
|
I'm having a problem reactivating a child form window when it's minimized to its icon state inside a parent window.
If I can avoid using the child window handle that would be great.
Any help will be appriecated. Thanks!
|
|
|
|
|
I have a windows application in C#, that has a form dialog, but doesnt require any user interaction. The form has a timer that closes itself.
MyForm form = new MyForm();<br />
dr = form.ShowDialog();<br />
form.Dispose();
I assigned a new task to run the application in the Task Scheduler. It runs when I am logged in.
However, when I am logged out, the scheduled application runs up to the point of showing the dialog, but throws an exception:
DialogSystem.InvalidOperationException: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service
Of course, Notepad set up the same way runs fine.
Can someone please point me in the right direction, either where to find the
result or what's happening?
Thanks for any and all help.
Ingram Leedy
You can't depend on your eyes when your imagination is out of focus.
--Mark Twain
|
|
|
|
|
You could try using form.Show() rather than ShowDialog() as this will load the form but not "Modally"...
...this might solve your problem but I'm a bit concerned that you might be solving the bigger problem in a "non-optimal" way...
Just a thought
Shaun.
|
|
|
|
|
I'm really after this - I have a progress form that is showing various information to the user when he is interactive.
Now if this application gets started non-interatively (ie, thru task scheduler when the user is logged out), I need the application to keep running as normal. It doesnt matter that the user sees the dialog or not.
Here is an example code:
ProgressForm progress = new ProgressForm();<br />
<br />
System.Threading.ThreadPool.QueueUserWorkItem( new System.Threading.WaitCallback( PerformCalculations ), progress );<br />
<br />
progress.ShowDialog();<br />
progress.Dispose();
Inside, my PerformCalculations there are bunches of callbacks to the form to update.
Is there a simple way to make the application behave the same for both interactive and non interactive?
Thanks!
Ingram Leedy
You can't depend on your eyes when your imagination is out of focus.
--Mark Twain
|
|
|
|
|
I need to loop through all components in a windows form. Is this possible, and if so, how do I do that?
What I really want to do is to get/set all components text-property in a windows form.
|
|
|
|
|
This will work for just the controls on the form:
foreach(Control subControl in myForm.Controls)
{
subControl.Text = "Howdy!";
}
However, if your controls have sub-controls (like a TabControl has it's own Control collection full of TabPages which then have their own controls), you'd have to use recursion.
SetSubControlText(Control ctrl, string text)
{
if(ctrl.Controls.Count > 0)
{
foreach(Control subControl in ctrl.Controls)
{
subControl.Text = text;
SetSubControlText(subControl);
}
}
}
If you call it like this: SetSubControlText(this, "Howdy!"); then you'll be passing the form to it and the method will loop through every control on the form, and their sub-controls, and set their text to Howdy!.
That should work...but I'm at school right now, and on their crappy computers without VS.NET, so this is untested. If it doesn't work, let me know and I'll look at it tonight.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
It works! Thank you very much
|
|
|
|
|
With the Windows API, I used GetSystemMetrics(SM_CXSCREEN)to get the screen size. How do I get it in .NET?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
That would be the Screen class in the System.Windows.Forms namespace in the .NET framework
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
Thanks, although that wasn't necessary.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Does anybody have a code snippet that shows how to find the namespace an object lives in?
Dim obj As Object<br />
Namespace = FindNamespace(Obj)
|
|
|
|
|
obj.GetType().Namespace or typeof(Object).Namespace
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
Thanks leppie
|
|
|
|
|
I have a Form that react to a delegate callback and create child controls according to the delegate event argument. But when I try to create the controls and set the parent to the Form at runtime, the subjected exception raised. Any solution on this?
e.g.
Class CA : System.Windows.Forms.Form
{
public CA()
{
CB b = new CB();
b.MyEvent += new OnMyEventHandler( this.OnMyEvent );
}
protected void OnMyEvent( int nCount )
{
for ( int i = 0; i < nCount; i ++ )
{
Button btn = new Button();
btn.Parent = this; <----- Exception
btn.Location = new Point( 100 + i * 100, 10 );
btn.Show();
}
}
}
public delegate void OnMyEventHandler( int nCount );
Class CB
{
public event OnMyEventHandler myEvent;
public CB
{
if ( myEvent != null )
myEvent( 5 );
}
}
Thanks!
|
|
|
|
|
if (control.InvokeRequired)
control.Invoke(...., .....);
else
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
Thanks for the hint. But I still have some further question.
The Invoke require a delegate as the arguement. What I want to ask is, if I dynamically create a number of buttons when a delegate callback triggered, can I set those buttons' parent to the original form?
|
|
|
|
|
The simplest solution is to marshal to call to the correct thread when the delegate is invoked:
class CA : System.Windows.Forms.Form
{
...
protected void OnMyEvent(int nCount)
{
if (this.InvokeRequired)
{
this.Invoke(new OnMyEventHandler(this.OnMyEvent));
}
else
{
for ( int i = 0; i < nCount; i ++ )
{
Button btn = new Button();
btn.Parent = this;
btn.Location = new Point( 100 + i * 100, 10 );
btn.Show();
}
}
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hi, I am new to C# and this message board, so I would appreciate any help I can get. I am writing and MDI application, where I have the parent screen split in two areas (with size of the area on the left about 20% of the MDI parent). The area on the left will be the navigation screen and on the right will display the window that results from user action taken on the left. I am trying to get the windows on the right to display the maximum size of its alloted area and I thought I can do this by adding it to a panel. Is it possible to add a form to a panel and if so can any provide some code on doing this. If not, is there some kind of container to restrict the child form size to its alloted area. Thanks.
|
|
|
|
|
Someone who wrote a book[^] about .NET interop has released a free tool[^] to monitor type marshaling inside the CLR. It takes advantage of .NET 1.1. It works on all machines, although Windows XP is required to show the balloon tooltips.
|
|
|
|
|
Clicking on the second link gives you a "Server error in / application."
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
The tool link works for me.
For others if you don't know about Adam Nathan, he is CLR Test Lead.
Don't and drive.
|
|
|
|