Results 1 to 3 of 3

Thread: User Drawn Window (form) Question

  1. #1

    Thread Starter
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908

    Post

    Howdy howdy all, just have a question or two

    I'm writing a small little app that emulates a window from another OS (amiga OS) just to see if it can be done with VB. I have a form without a border, and instead, have images with the gui graphics displaying (there is no worry about resources here ... heh) I have a minimize/maximize gadget, a close window gadget, a zorder gadget, and a resize gadget. I have searched high and low for any info/tips/etc. on how to do these two things:

    1) I'd like to resize the form, keeping the resize gadget in the lower right corner at all times, and not have the mouse pointer jump to 0,0 of the image and be able to resize the form properly, with a minimum of the titlebar height + the lower scrollbar height and the left border's width + the right scrollbar's width (approximately 21 pixels for the titlebar (height), 18 pixels for the lower scrollbar (height), 18 pixels for the right scrollbar (width), and 2 pixels for the left border (width)).

    2) How does the form's ZOrder work? I'm not quite sure when you click on the ZOrder gadget (upper right corner) the window should either move to the back or move to the front depending on it's current position.

    I already have a very nice bit of code to move the window around using the titlebar, but these two functions are a major necessity If anyone can help, I'd be really appreciative.

    -Excalibur

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    If you create a normal form, remove the caption and set the ControlBox property to false you have a resizable window.
    Subclass it and catch the WM_GETMINMAXINFO message, there you can set the min and max size of your form, and it very descent (much better then using the resize event for that).

    If you put that resize-thing you have in a picure box alligned to the bottom, it always stays there... only need to place the resize-pic you use at the right of that pic box.

    The zorder property of a form nly works (AFAIK) for forms within the same project.

  3. #3

    Thread Starter
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908

    Post

    Nifty little trick (form w/o caption, w/o control box) but I need this completely user drawn (and actually including the menu ...) The OS I'm emulating the GUI for does not allow you to resize using all the edges, just the gadget on the lower right (AmigaDOS Workbench). I have the close/min/max icons working though.

    The forms that are created are all from the same project. I have a simulated desktop, which must always stay in the back, and the rest must appear on top of this form. The ZOrder gadget sends windows (other than the desktop) either to the front or to the back, depending on where they are when the zorder gadget is clicked. I was thinking about making the desktop an MDI form, and I think I've got code to get rid of the caption/control box for that. The only problem with that is the desktop is able to either be the backdrop (like win95) or a freefloating window. I can't have 2 mdi forms in the same project (bleh).

    Heh, I realize I've got my work cut out for me Another problem is setting up the desktop's titlebar to display a menu when you right-click on the titlebar, otherwise it displays version and memory information. *grin* I guess I can work a bit with the captionless/controlboxless form for normal forms, but I need to disable the resize on any side but the lower right corner...

    -E

    Originally posted by Crazy D:
    If you create a normal form, remove the caption and set the ControlBox property to false you have a resizable window.
    Subclass it and catch the WM_GETMINMAXINFO message, there you can set the min and max size of your form, and it very descent (much better then using the resize event for that).

    If you put that resize-thing you have in a picure box alligned to the bottom, it always stays there... only need to place the resize-pic you use at the right of that pic box.

    The zorder property of a form nly works (AFAIK) for forms within the same project.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width