Solved

Mdi form without border

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

809 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