Solved

Add minimize and maximize button to fixed dialog

Posted on 2006-11-09
2
311 Views
Last Modified: 2008-01-09
Hi guys,

I want to have a form that has typical set of title buttons. Min/Max/Close. I want to block Max. What I have right now is a sizeable form with Max button blocked and also I use this code to prevent user from resizing manually:

Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const SC_SIZE = &HF000&
Public Const MF_BYCOMMAND = &H0&

Private Sub Form_Load()
    Dim hMenu As Long
    Dim fSuccess As Long
   
    hMenu = GetSystemMenu(Me.hwnd, 0)
    fSuccess = DeleteMenu(hMenu, SC_SIZE, MF_BYCOMMAND)
End Sub

It won't let resize but whenever I put mouse over the border it shows that resize arrow cursor. I want a regular cursor.

Is there a way to show default cursor in this case? If no, how can I add min and max buttons (with max being blocked) on form set to fixed dialog?
0
Comment
Question by:RealSnaD
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 17909407
How about using?...
   
    BorderStyle = 1- Fixed Single
    MaxButton = False
    MinButton = True
    ShowInTaskBar = False
0
 
LVL 7

Author Comment

by:RealSnaD
ID: 17909456
How about an A?

Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now