rekam Posted October 28, 2003 Posted October 28, 2003 Hello, I need some help once again:p ! It's something very simple...but it don't works. I want my Form to take all the screen (so you don't see the taskbar). I would like no minimize, maximize, well no control box at all, and I would like a title in the blue bar on the top. For that, it's okay. But now, there's the problem. When you click on the blue bar, you can drag the form and move it. It't not very good for my application. I saw a property <locked>. "Great", I thought. But in TRUE, it's locking anything. You can move the form as you want. I tried to do use sub, which replace the form on the top-left edge of the screen, something like that : Private Sub myForm_LocationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.LocationChanged Me.Location = New System.Drawing.Point(0, 0) Me.DesktopLocation = New System.Drawing.Point(0, 0) Me.Left = 0 Me.Top = 0 Me.SetDesktopLocation(0, 0) Me.SetDesktopBounds(0, 0, 800, 600) End Sub ...No way, you can move the form by clicking on the blue bar...urps, but why :confused: Is there something I missed ?? Thanks for help Quote
*Experts* Nerseus Posted October 29, 2003 *Experts* Posted October 29, 2003 You might be able to handle the WndProc and look for the WM_MOVE message and cancel it. I haven't tried it, but it should work. I'm not sure WHY you'd ever want to prevent moving a full screen window but there ya go. -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
bri189a Posted October 29, 2003 Posted October 29, 2003 the Locked property has nothing to do with moving the screen. Locked is used more on text boxes; it's similiar to Enabled; with Locked though things aren't greyed out, you can put the cursor there but you just can't edit what's there. For the movement: (I use C# so forgive the possible syntax errors) [C#] this.Bounds = Screen.PrimaryScreen.Bounds [/C#] for VB I think it would be: Me.Bounds = Screen.PrimaryScreen.Bounds You can get rid of all that other code... it's redundant Then on the properties for you Form (or in code) change the FormBorderStyle to None. Word of advice... put yourself a button on the form that closes the form and make sure you assign the code and test it before doing the changes I mentioned above otherwise you may end up not getting your form to close once you open it other than by doing ctl+alt+del. Brian Quote
rekam Posted October 29, 2003 Author Posted October 29, 2003 Well, Brian, I think Me.Bounds = Screen.PrimaryScreen.Bounds doesnt exists in VB. It's either location or SetDesktopBounds, but it doesn't work. And a little question for Nerseus. Why is it a strange idea to lock a window ? I just decide to do this on my own, but if it's totally useless, I can drop this idea. Quote
bri189a Posted October 30, 2003 Posted October 30, 2003 Me.Bounds should, it's in C# and they both use .NET and the Bounds property is part of the Control namespace (System.Windows.Forms), which you must have to have any forms... and this is the fully qualified name for Screen: System.Windows.Forms.Screen If nothing else Bounds is just a rectangle, do you have a Me.Rectangle? I'll wipe the dust off my VB.NET app and find out for sure tonight and try to remember to get back with you and get it to work for you, and Nerseus, one possible idea is what I use it for - sloppily thrown together games! :) Brian Quote
*Experts* jfackler Posted October 30, 2003 *Experts* Posted October 30, 2003 How's about this: Me.DesktopBounds = Windows.Forms.Screen.PrimaryScreen.Bounds Jon Quote
*Experts* jfackler Posted October 30, 2003 *Experts* Posted October 30, 2003 Or this one?: Me.DesktopLocation = Windows.Forms.Screen.PrimaryScreen.WorkingArea.Location Jon Quote
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.