Solved

frm.visible.false, frm.hide, notopmost ---what diff.

Posted on 1998-09-17
3
213 Views
Last Modified: 2008-02-01
What the difference between

1)frm.visible=false
2)frm.hide
3) Call SetWindowPos(Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)

Of course theres also show, true, top

I'm confused as to which to use all the time

Please Do not answer unless a complete explanation is included.
0
Comment
Question by:BillyBob
  • 2
3 Comments
 
LVL 2

Expert Comment

by:MelissaC
ID: 1435431
1. frm.visible=false makes the frame invisible.
2. frm.hide hides the window
(I think one of the above cannot receive windows messages, I don't exactly know, I'll find out in a minute...)
3. SetWindowPos (HWND_NOTOPMOST) makes the window "Not topmost"
If a window is TOPMOST, it will always be on top of all the other windows that are not TOPMOST, even if the window is not active. When the window is NOTOPMOST, it will still be visible. (gray titlebar in stead of blue).

What do you want to do with your window?

0
 
LVL 2

Accepted Solution

by:
MelissaC earned 50 total points
ID: 1435432
Alright, here is the answer from the VB guide:

-------------------
The "Visible" Property


Returns or sets a value indicating whether an object is visible or hidden.
Syntax
object.Visible [= boolean]
      ..
The Visible property syntax has these parts:
Part      Description

object      An object expression that evaluates to an object in the Applies To list.
boolean      A Boolean expression specifying whether the object is visible or hidden.
      ..
Settings
The settings for boolean are:
Setting      Description

True      (Default) Object is visible.
False      Object is hidden.
      ..
Remarks
To hide an object at startup, set the Visible property to False at design time. Setting this property in code enables you to hide and later redisplay a control at run time in response to a particular event.
Note   Using the Show or Hide method on a form is the same as setting the form's Visible property in code to True or False, respectively.  <----- I think that's what you wanted to know...
-------
About TOPMOST etc:
Windows uses some kind of ZOrder to determine which windows overlap other windows (or controls). The topmost window is on top of all the other windows. a NOTOPMOST window is not. It's as easy as that. You could look in the Visual Basic Books online how to play with the ZOrder. Most control have the ZOrder property.

0
 

Author Comment

by:BillyBob
ID: 1435433
frm.show remembers the last focus position, frm.true does not.
Is there other differences?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

792 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