Solved

Mdi form without border

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

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

Title # Comments Views Activity
Link a textbox in excel to a cell with more than 255 characters. 5 66
Validating VB6 Function 19 56
VBS file using code from 2nd file (txt or vbs) 4 30
Adding to a VBA? 6 61
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

912 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

19 Experts available now in Live!

Get 1:1 Help Now