Solved

Remove MDI Title Bar or increase size

Posted on 2000-04-12
5
221 Views
Last Modified: 2010-05-02
I'm need to do one of two things:-

1) Remove the title bar of an MDI form

2) Increase the size so that the title bar is off the screen yet make the window big enough to cover the screen. Currently Vb/windows limits how big my MDI window can be.

Thanks.
0
Comment
Question by:CharlieM
  • 2
  • 2
5 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2708713
yes even with the api i could not increase the window size, but only move the title bar off screen.  what are you trying to do?  perhaps there is an alternative.
0
 
LVL 15

Accepted Solution

by:
ameba earned 100 total points
ID: 2708777
' mdichild form Form1 :borderstyle=0, no code

' mdiform: appearance=0 (optional), paste this code
Option Explicit
Private Const GWL_STYLE = (-16)
Private Const WS_SYSMENU = &H80000
Private Const WS_CAPTION = &HC00000
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Sub MDIForm_Click()
    MsgBox ScaleWidth / 15 & " x " & ScaleHeight / 15
    Unload Me
End Sub

Private Sub MDIForm_Load()
    Dim style As Long
    style = GetWindowLong(hwnd, GWL_STYLE)
    style = style And Not WS_SYSMENU
    style = style And Not WS_CAPTION
    style = SetWindowLong(hwnd, GWL_STYLE, style)
    Move -45, -45, 20000, 20000
    Form1.Show ' show mdichild (also without border)
End Sub
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2708806
good job ameba!  =)
0
 

Author Comment

by:CharlieM
ID: 2708868
Once again experts exchange solves a problem!

Good job indeed ameba. Thanks!
0
 
LVL 15

Expert Comment

by:ameba
ID: 2709523
:) Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

863 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

24 Experts available now in Live!

Get 1:1 Help Now