How to make minimizable, but non-stretch form? 
Author Message
 How to make minimizable, but non-stretch form?

VB4/32...
I know how to make a form that's sizable so I can minimize it, but then
that also means it can be stretched.  So, I add code to undo a window
stretch after its done (use Screen.ActiveForm.Width=x, etc., in resize
event).  But I hate the fact that it's a kludge and the window can be
stretched.  So, how do I make a minimizable, but non-stretch form?  What
Win32 API call do I use?  Or, do I need a MessageHook.OCX?

I like dialog-type windows, but these days I need to make them minimizable
so users can multi-task with other apps better.  It's becoming the "in"
thing to do.



Thu, 14 Jan 1999 03:00:00 GMT  
 How to make minimizable, but non-stretch form?

Quote:
> stretched.  So, how do I make a minimizable, but non-stretch form?  What
> Win32 API call do I use?  Or, do I need a MessageHook.OCX?

There are two seperate properties for what you are trying to do.  (If I
get these names wrong, at least you get the idea)  The "MinBox" property
and then "BorderStyle" property.  Each do what it says.  Simply change the
"MinBox" property to true and the "BorderStyle" property to fixed-dialog.

-Corey



Fri, 15 Jan 1999 03:00:00 GMT  
 How to make minimizable, but non-stretch form?


Quote:
>VB4/32...

Well I'm still using VB3/Win3.1x  :-)

Quote:
>I know how to make a form that's sizable so I can minimize it, but then
>that also means it can be stretched.  So, I add code to undo a window
>stretch after its done (use Screen.ActiveForm.Width=x, etc., in resize
>event).  But I hate the fact that it's a kludge and the window can be
>stretched.  So, how do I make a minimizable, but non-stretch form?

For Win 3.1x, this is in the KB:

        Q118376: How to Lock a Form so it Cannot Be Moved

Oddly enough, this is done by removing the "Resize" menu item from the
control box. In Win3.1x, that's the drawer in the top left of the
form, next to the title bar.

Apparently, if you remove the "Resize" menu item, you can no longer
grasp the border of the form, so the size is fixed. The mouse still
changes to a double arrow when it's over the edge, though.

Also, by removing the "Move" menu item, you can no longer grab the
title bar, and the position of  the form can no longer be changed
using the mouse alone.

So set the form's MaxButton property to False, MinButton to True, and
add the appropriate code in the Form_Load procedure, and things should
work out.

Anyway, I would be surprised if things didn't work in a similar way in
Win95. Most likely, there will be some equivalent article in the KB,
specifically for VB4/Win95.

Hope I got you going,

Bart Lateur,
Gent, Belgium.

--- Embracing the KIS principle: Keep It Simple

Quote:
> and I won't call people stupid, just to get an extra 'S'!



Fri, 15 Jan 1999 03:00:00 GMT  
 How to make minimizable, but non-stretch form?


Quote:
>stretched.  So, how do I make a minimizable, but non-stretch form?  What
>Win32 API call do I use?  Or, do I need a MessageHook.OCX?

Perhaps I am missing what you said... I think you just want to set the
form's border to fixed single, and the minButton to true.

  -- Robert



Sat, 16 Jan 1999 03:00:00 GMT  
 How to make minimizable, but non-stretch form?

What's the problem?  In the form's borderstyle property set it to fixed
single or fixed double.

Shelly



Sat, 16 Jan 1999 03:00:00 GMT  
 How to make minimizable, but non-stretch form?


Quote:

>>So, how do I make a minimizable, but non-stretch form?
>.BorderStyle = 1
>.MinButton = True

Hi

The mdi-form does not have these properterties. Is there a way to do
the same thing with such a form. I have done this with a timer that
checks the size and the position of the form once a second. Not a very
elagant solution! Does anyone have a better one?

Yours

Peter

www.tallstugan.se



Sat, 16 Jan 1999 03:00:00 GMT  
 How to make minimizable, but non-stretch form?


Quote:
>So, how do I make a minimizable, but non-stretch form?

.BorderStyle = 1
.MinButton = True

--
VB Info: http://www.sn.no/~balchen/vb/visual.htm
FAQ: http://www.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://www.sn.no/~balchen/vb/kb.htm



Sat, 16 Jan 1999 03:00:00 GMT  
 How to make minimizable, but non-stretch form?



Quote:
> VB4/32...
> I know how to make a form that's sizable so I can minimize it, but then
> that also means it can be stretched.  So, I add code to undo a window
> stretch after its done (use Screen.ActiveForm.Width=x, etc., in resize
> event).  But I hate the fact that it's a kludge and the window can be
> stretched.  So, how do I make a minimizable, but non-stretch form?  What
> Win32 API call do I use?  Or, do I need a MessageHook.OCX?

set borderstyle to fixed,
remove the control-box entirely (in the properties window),
and add your own 'close' button, with a pretty little piccy on it:
   Sub btn_Close_click ()
      Unload me' (or Me.Hide)
   End Sub

Your own buttons can be *so* much nicer than the standard windows stuff.

Steve.



Sat, 16 Jan 1999 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Making a form non-resizeable or control non-clickable

2. SP3 Made VB Form Wizard Non Func.

3. how to make form minimizable (give it that minimize button on top)

4. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

5. Making the Form invisible but making the controls seen

6. Making ODBC linked tables non-updatable

7. Making Word2k non-interactive

8. Making a Non-UI (or Invisible at runtime) control

9. MAKING A RECORD NON-UPDATABLE

10. Making VB appl for non-USA use

11. Making a window non-sizeable at run-time (VB5)

12. DTPicker control -- making input box background non-white

 

 
Powered by phpBB® Forum Software