@labq5, There are easier ways to make your form borderless. You do however need to open a new thread of your own. This was only a code snippet from 2009, I doubt it if anyone will answer your question.
I'll reply on your new thread once it is open.:)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Hi, labq5
Sorry for this mistake...
tCoord is a structure I define in a module:
'TIPOS DE DADOS NECESSARIOS
Type tCoord
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
It holds the information of my desktop bounds, this way I can resize my form to the max available space on the screen without covering the taskbar (if you maximize a borderless form, it will cover the taskbar, and I hate this behaviour!).
The AreaTrabalho function performs the calculation of available desktop area, as I mentioned before.
Here is the code for that function:
Public Function AreaTrabalho() As tCoord
Dim rCoord As tCoord
On Error GoTo errAreaTrabalho
If SystemParametersInfo(48, vbNull, rCoord, 0) Then
AreaTrabalho = rCoord
End If
Exit Function
errAreaTrabalho:
MsgBox "Erro na execução da rotina:" & vbNewLine & vbNewLine & Err.Number & " - " & Err.Description, vbExclamation, "AreaTrabalho"
End Function
Both declarations (the structure and the function) are typed in a module, this way it can be used for any form in your application.
In addition, all code showed in the original post can be put in a module, only the piece "MDIForm_Activate()" should be on form's activate event, AND YOU NEED to declare this API function too:
Private Declare Function SystemParametersInfo Lib "USER32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
(make it on the same module you put the function into)
Hope it helps!
Sidnei
sidnei
Junior Poster in Training
55 posts since Dec 2009
Reputation Points: 22
Solved Threads: 10
Hi, AndreRet!
This is an older post, I agree...
But I reply to it cause I have a extremely dificult to find ANY information on how to put a MDI form borderless.
Do you know a way to do it more simpler? Note that I'm using VB6 under Windows XP, and it's not a common form, but a MDI form, the one that doesn't have the "BorderStyle" property to be set on the properties window...
Can you put a link or piece of code to show how to make this task easier?
I know it's an older thread, but I'm really interested...
Best regards,
Sidnei
sidnei
Junior Poster in Training
55 posts since Dec 2009
Reputation Points: 22
Solved Threads: 10
No problem, I'll post it tomorrow, time for my daily beer.;)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
@Sidnei, seems I'm getting older. Your way is about the quickest and best. I gave you your rep back.;)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350