From: David Youngblood on
"John S" <nospam> wrotel...
>
> How can I set the MDI form so that the user can not resize its dimension
> (height, width) using mouse ?
>
> Thanks
> john s

Changing the window style seems to work, but may need more testing.

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

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA"
( _
ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As
Long

Private Const GWL_STYLE = (-16)
Private Const WS_THICKFRAME = &H40000

Private Sub MDIForm_Load()
Dim dwStyle As Long
dwStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
SetWindowLong Me.hwnd, GWL_STYLE, dwStyle And (Not WS_THICKFRAME)
End Sub

David


From: DanS on
"Jeff Johnson" <i.get(a)enough.spam> wrote in
news:e8hrlW#uKHA.4752(a)TK2MSFTNGP04.phx.gbl:

> "Karl E. Peterson" <karl(a)exmvps.org> wrote in message
> news:%23sbfb39uKHA.4636(a)TK2MSFTNGP06.phx.gbl...
>
>>>>> How can I set the MDI form so that the user can not resize its
>>>>> dimension
>>>>> (height, width) using mouse ?
>>>>
>>>> I haven't done an MDI project, but aren't the MDI child forms just
>>>> a form
>>>> and you can set the BorderStyle to fixed ?
>>>
>>> No, an MDIForm is different from a Form. The BorderStyle property
>>> was intentionally left off of this class because Microsoft wanted
>>> all MDI apps to behave a certain way, and resizability was part of
>>> that way. Hence my first reply to the OP.
>>
>> I thought MDIChild form initially too, but then after seeing your
>> response I wondered if he wasn't really asking what he asked about?
>> <G> That is, restricting the size of the MDI parent form. (I agree,
>> the children really shouldn't be so restricted - that'd be the roll
>> of a pop-up toolwindow, or something similar.)
>
> Actually, now that you mention it I see that Dan said "child" forms,
> but I was working off the original intent of the OP and just glossed
> over that word!

Was I wrong ?

The OP wasn't clear, and I assumed the child form was the intent.

I just did look in VB, and the child forms do have a border style
property but the parent does not.
From: Jeff Johnson on
"DanS" <t.h.i.s.n.t.h.a.t(a)r.o.a.d.r.u.n.n.e.r.c.o.m> wrote in message
news:Xns9D3253DD3D9B2thisnthatroadrunnern(a)216.196.97.131...

>> Actually, now that you mention it I see that Dan said "child" forms,
>> but I was working off the original intent of the OP and just glossed
>> over that word!
>
> Was I wrong ?
>
> The OP wasn't clear, and I assumed the child form was the intent.
>
> I just did look in VB, and the child forms do have a border style
> property but the parent does not.

Well, the subject line said MDI form, so I took it verbatim. Add to that the
fact that there isn't much point in asking about child forms since, as you
say, they DO have the BorderStyle property, and I'd say it's likely he was
asking about true MDIForm objects.


From: DanS on
"Jeff Johnson" <i.get(a)enough.spam> wrote in
news:Oplon#GvKHA.3536(a)TK2MSFTNGP06.phx.gbl:

> "DanS" <t.h.i.s.n.t.h.a.t(a)r.o.a.d.r.u.n.n.e.r.c.o.m> wrote in message
> news:Xns9D3253DD3D9B2thisnthatroadrunnern(a)216.196.97.131...
>
>>> Actually, now that you mention it I see that Dan said "child" forms,
>>> but I was working off the original intent of the OP and just glossed
>>> over that word!
>>
>> Was I wrong ?
>>
>> The OP wasn't clear, and I assumed the child form was the intent.
>>
>> I just did look in VB, and the child forms do have a border style
>> property but the parent does not.
>
> Well, the subject line said MDI form, so I took it verbatim. Add to
> that the fact that there isn't much point in asking about child forms
> since, as you say, they DO have the BorderStyle property, and I'd say
> it's likely he was asking about true MDIForm objects.

It didn't even occur to me that the OP may have been asking about the
parent MDI form. It doesn't make any sense ....not to me anyway.
From: Jeff Johnson on
"DanS" <t.h.i.s.n.t.h.a.t(a)r.o.a.d.r.u.n.n.e.r.c.o.m> wrote in message
news:Xns9D3269CA88800thisnthatroadrunnern(a)216.196.97.131...

>>>> Actually, now that you mention it I see that Dan said "child" forms,
>>>> but I was working off the original intent of the OP and just glossed
>>>> over that word!
>>>
>>> Was I wrong ?
>>>
>>> The OP wasn't clear, and I assumed the child form was the intent.
>>>
>>> I just did look in VB, and the child forms do have a border style
>>> property but the parent does not.
>>
>> Well, the subject line said MDI form, so I took it verbatim. Add to
>> that the fact that there isn't much point in asking about child forms
>> since, as you say, they DO have the BorderStyle property, and I'd say
>> it's likely he was asking about true MDIForm objects.
>
> It didn't even occur to me that the OP may have been asking about the
> parent MDI form. It doesn't make any sense ....not to me anyway.

Heh, then we're on the same page.