|
-
Jul 25th, 2004, 01:16 AM
#1
Thread Starter
Lively Member
Maximize form [Resolved]
Is there a way programatically to keep someone from double clicking on a form and it maxamizing full screen? Just changing the property of the MaximizeBox to Fale does not work.
My problem is that I am working with a borderless form and can't set the BorderStyle = Fixed and not have the title bar at top at the same time.
Mucho thanks...
Last edited by teamdad; Jul 25th, 2004 at 04:32 PM.
-
Jul 25th, 2004, 04:34 AM
#2
Sleep mode
In the Form SizeChanged event , try this :
ME.Size=Me.Size '
I can't check if this is correct right now (at work... )
-
Jul 25th, 2004, 05:23 AM
#3
Lively Member
Originally posted by Pirate
In the Form SizeChanged event , try this :
ME.Size=Me.Size '
I can't check if this is correct right now (at work... )
No need for code. Set MaximizeBox property to False in the Windows Forms Designer's properties tab, and the maximize button on the form will be disabled.
Do you think my life is easy?
Do you think it's good to win?
do you think it's nice to kill?
Do you think learning is a must?
Do you think computers are nothing?
Do you think this post is stupid?
Do ypu think we're really humen?
DO YOU THINK IT'S GOOD TO THINK AT ALL? ? ? ! ! !
-
Jul 25th, 2004, 05:27 AM
#4
PowerPoster
Re: Maximize form
Originally posted by teamdad
Is there a way programatically to keep someone from double clicking on a form and it maxamizing full screen? Just changing the property of the MaximizeBox to Fale does not work.
My problem is that I am working with a borderless form and can't set the BorderStyle = Fixed and not have the title bar at top at the same time.
Mucho thanks...
Hi,
I'm confused here.
1. Just double clicking on the form does NOT maximise it -
unless you have written that into the form's doubleclick
event.
2. Setting the maximise box property to false DOES work. It
makes the button unavailable.
3. The term "FullScreen" has an allocated meaning. It means the form taking up the entire screen - no minimise, maximise or exit buttons nor form name (in fact the entire form control box) being visible.
Please clarify.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 25th, 2004, 06:11 AM
#5
Sleep mode
Originally posted by Pirate
In the Form SizeChanged event , try this :
ME.Size=Me.Size '
I can't check if this is correct right now (at work... )
Don't bother , this won't work as I thought .
Best way is to intercept the msg in the WndProc event .
-
Jul 25th, 2004, 06:13 AM
#6
Sleep mode
Originally posted by TLord
No need for code. Set MaximizeBox property to False in the Windows Forms Designer's properties tab, and the maximize button on the form will be disabled.
I know this , but apparently he doesn't want to do this .
-
Jul 25th, 2004, 06:18 AM
#7
Lively Member
Sory for late reply,
Pirate I apologise, I ddin't read his post cearfully
Do you think my life is easy?
Do you think it's good to win?
do you think it's nice to kill?
Do you think learning is a must?
Do you think computers are nothing?
Do you think this post is stupid?
Do ypu think we're really humen?
DO YOU THINK IT'S GOOD TO THINK AT ALL? ? ? ! ! !
-
Jul 25th, 2004, 08:52 AM
#8
Thread Starter
Lively Member
Here's an example: Open Notepad or Internet Explorer; make sure that it's window size is not maximized and double click on the title bar. Boom!! it openes the full view of the screen. It's not the literal meaning of "full screen" hiding the title bar etc.. now double click on the title bar again and it goes back to the position and size it started out being.
I don't have a title bar to click on, I have the minimize and maximize set to False, yet whe you double click anywhere on the form it does exactly the same as my example.
The only thing in my code that may be troubling this is that I use WndProc as a means to move the form around on the screen since I don't have a title bar to do it with. It's probbably related to my double click problem in some way... is there any other thoughts?
Code:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
MyBase.WndProc(m)
If m.Msg = &H84 Then
If m.Result.ToInt32 = 1 Then m.Result = New IntPtr(2)
End If
End Sub
-
Jul 25th, 2004, 02:53 PM
#9
PowerPoster
Originally posted by teamdad
I don't have a title bar to click on, I have the minimize and maximize set to False, yet whe you double click anywhere on the form it does exactly the same as my example.
The only thing in my code that may be troubling this is that I use WndProc as a means to move the form around on the screen since I don't have a title bar to do it with. It's probbably related to my double click problem in some way... is there any other thoughts?
That does not happen in ordinary VB.NET windows forms. It must be someting to do with WndProc.
There is no "TitleBar" in VB.NET. The blue bar containing the form name and the buttons for Min; Max & Close is the "ControlBox"
Sorry. I can't help you with your problem.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 25th, 2004, 03:38 PM
#10
Thread Starter
Lively Member
Somethings not right with it at all. Taking out the code to move the form around when clicked on holding the mouse button down and it don't do it at all. I even tried a diffrent set of code dealing with position and reposition of the mouse to move the form that didn't have anything to do with WndProc and it did the same thing.
I guess I will have to keep searching for a way to move the borderless form another way and somehow get around this issue.
-
Jul 25th, 2004, 04:31 PM
#11
Thread Starter
Lively Member
Thought I would post an FYI for all those that looked at this and along with me "scratched your heads" I found a code snippet and found a work around to allo moving the borderless form and it don't do the double click expando thing.... YEA!!! 
Code:
Dim newPoint As New System.Drawing.Point()
Dim a As Integer
Dim b As Integer
Public ScreenWidth As Integer = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
Public screenHeight As Integer = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
a = Me.MousePosition.X - Me.Location.X
b = Me.MousePosition.Y - Me.Location.Y
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If e.Button = MouseButtons.Left Then
newPoint = Me.MousePosition
newPoint.X = newPoint.X - (a)
newPoint.Y = newPoint.Y - (b)
Me.Location = newPoint
'Docks Form top left and right corners
If Me.Location.X < 8 And Me.Location.Y < 8 Then
Me.Location = New System.Drawing.Point(0, 0)
End If
If Me.Location.X > (ScreenWidth - (Me.Size.Width)) + 8 And Me.Location.Y < 8 Then
Me.Location = New Point(ScreenWidth - Me.Size.Width, 0)
End If
Else
End If
End Sub
-
Jul 25th, 2004, 05:07 PM
#12
Frenzied Member
with what pirate said, just do this:
[Highlight=VB]
me.size = new system.drawing.size(height as int, width as int)
[Highlight=VB]
i don't have vs up right now but i think thats the right class/namespace. i don't even know if that'll work
-
Jul 25th, 2004, 05:08 PM
#13
Frenzied Member
but wait. you said it's a borderless form, right? how can a user double click a titlebar with no border?
-
Jul 26th, 2004, 01:31 AM
#14
Sleep mode
Originally posted by Andy
but wait. you said it's a borderless form, right? how can a user double click a titlebar with no border?
Nice catch.. . this is confusing now...
-
Jul 26th, 2004, 02:23 AM
#15
Originally posted by teamdad
I don't have a title bar to click on, I have the minimize and maximize set to False, yet whe you double click anywhere on the form it does exactly the same as my example.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|