GenDeathRaiser Posted May 16, 2005 Posted May 16, 2005 I tried searching for this but it won't allow me to search for Always, On, or Top so it blows. Anyway, How can I set my program to be always on top? :confused: Quote
Phylum Posted May 16, 2005 Posted May 16, 2005 In vs2003 set the forms topmost property to true. All done :) Quote
GenDeathRaiser Posted May 16, 2005 Author Posted May 16, 2005 I got this after doing that: [C# Error] AssemblyInfo.cs(315): An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.Form.TopMost' lets just say my forms named WinForm, what would be the syntax to use that command properly. Quote
Phylum Posted May 16, 2005 Posted May 16, 2005 Go to the designer screen, and open the properties window for your form... its near the bottom :) Quote
GenDeathRaiser Posted May 16, 2005 Author Posted May 16, 2005 Yes but I'm trying to get it so that the user can check the Always Stay On Top box so no other programs get in the way. So how would I go about making it true and false I tried: WinForm.TopMost = true; but it gave me that error above. Quote
*Experts* mutant Posted May 16, 2005 *Experts* Posted May 16, 2005 Is WinForm the name of your form class, or does it reference a specific instance of your form? The latter is required to use that property since it is specific to each instance. Quote
GenDeathRaiser Posted May 16, 2005 Author Posted May 16, 2005 Well...When I click the form, that's the name of it. I don't see anything that has a higher power than that as it's my only form. And if I set it to true in the properties, it works, but I need it to be able to turn on and off and I guess my syntax is off. Quote
GenDeathRaiser Posted May 16, 2005 Author Posted May 16, 2005 I Even just tried the namespace which is Typer so I did Typer.WinForm.TopMost = true; but still no good :(. Quote
Administrators PlausiblyDamp Posted May 16, 2005 Administrators Posted May 16, 2005 In your code WinForm is the class name (or type) of the form. You need to set it for the current instance. Try using this.TopMost = true; Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.