how to mimimize an application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am using C#, i dont know to know how to minimize the application in
Taskbar when i click the button(its not minimizebox button), that means how
to handle it?? normally if u click the minimize button on the form it will
minimize the form, how can i do it in a simple button click event

Regards
Saravanan
 
Hi iam planning to handle this in some different way.
using sendkeys.send() method to minimize the application, for that i have to
pass the argument of (LWin+M). Lwin is for windows logo key and M, these
combination will minimize the application, but the problem is how to pass
this combination to sendkeys.Send(), i searched in the net but so far nothing
i got regarding this, Can u please help so that i can implement this feature

Regards
 
Hi,
try this code in the click event of the button:
myForm.WindowState = FormWindowState.Minimized;
 
Hi,
you can get reference to parent form by this code:
this.ParentForm.WindowState = FormWindowState.Minimized;
 
Hi,
I think senkeys is not appropriate in this scenario.By that it will become
unnecessarily complex.I have one request is that if you have found my post
helpful then please do click "Yes" at "Was this post helpful to you?"
 
Saravanan said:
I am using UserControl, that property is not there

\\\
Dim ParentForm As Form = Me.FindForm()
If ParentForm IsNot Nothing Then
ParentForm.WindowState = FormWindowState.Minimized
End If
///
 
Saravanan said:
Thanks its working, How can i do it with Sendkeys.Send() method..

Why would you want to do that? 'SendKeys.Send' is always problematic
because there is no guarantee the input is directed to the expected window.
 
Back
Top