Solved

Mdi form without border

Posted on 2004-04-04
4
427 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reading the Contents of a Directory In Access VBA 5 87
VB6 - Compare and highlight cell not the same 3 56
Added a column screws up code 5 69
RUNRMTCMD from AS/400 12 86
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

735 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