Solved

Mdi form without border

Posted on 2004-04-04
4
422 Views
Last Modified: 2008-03-17
Hi
In VB, Normal form has a Borderstyle property that can set to "no border".
(When set to no border this form fill all of screen)
but One mdi form has not this property.
I want my mdi form has not border and fill all of screen.
0
Comment
Question by:msalari
  • 2
4 Comments
 
LVL 11

Expert Comment

by:dbrckovi
ID: 10755369
Try this:
http://www.visualbasicforum.com/showthread.php?t=71750

I'm having dificulties copying an pasting. Everything goes to a single line in VB.
But maybe you'll have more luck.

I'm not sure if this will work with MDI forms.

According to my experience, I don't think it's possible to change MDI form border style. I mean, have you ever seen a MDI form without border (in any application)?
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 50 total points
ID: 10756708
Try this:


Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const WS_CAPTION = &HC00000
Private Const GWL_EXSTYLE = (-20)
Private Const GWL_STYLE = (-16)
Private Const WS_BORDER = &H800000
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_PAINT = &HF

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long


Private Sub MDIForm_Click()
    Dim wStyle As Long
    wStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    wStyle = wStyle Xor WS_CAPTION
    wStyle = wStyle Xor WS_BORDER
    SetWindowLong Me.hwnd, GWL_STYLE, wStyle
    Me.WindowState=vbMaximized
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10756715
You can move it from click() to paint() or load() if you wish.


_Brian
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 10756743
Try this

don't know whether it works for mdi but you can pass the hwnd and try


http://www.mvps.org/vb/code/FormBdr.zip
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

708 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

15 Experts available now in Live!

Get 1:1 Help Now