469,903 Members | 2,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

dialog box with no border? (access xp)

tom
Hey All,

While running some code, I'd like to open a form as a dialog box (so
that the code will wait for the form to be closed/hidden -- easy to do
using the acDialog argument), but I would like this form to have NO
BORDER. Is this possible in any way? Can the form, upon opening, strip
off its own border?

????
-Tom
Nov 12 '05 #1
10 5423
Hi,

On 20 Dec 2003 00:48:44 -0800, tom wrote:
While running some code, I'd like to open a form as a dialog box (so
that the code will wait for the form to be closed/hidden -- easy to do
using the acDialog argument), but I would like this form to have NO
BORDER. Is this possible in any way? Can the form, upon opening, strip
off its own border?


if you can have a special form for that, you may set the
BorderStyle-property accordingly from the form's property-sheet.

If you need to use a form that needs its border when called from somewhere
else, you'd have to change the form prior to calling, with something like:

dim strFormName as string
dim lngOrgStyle as long

strformname="NameOfFormHere"

'store original state, change to 'None'
domcmd.openform _
formname:=strformname, _
view:=acdesign , _
windowmode:=achidden
lngorgstyle=forms(strformname).borderstyle
forms(strformname).borderstyle=0
docmd.close acform,strformname,acsaveyes

domcmd.openform _
formname:=strformname, _
windowmode:=acdialog

'your actions here
[...]

'restore original style
domcmd.openform _
formname:=strformname, _
view:=acdesign , _
windowmode:=achidden
forms(strformname).borderstyle=lngorgstyle
docmd.close acform,strformname,acsaveyes
end sub

Check out the "Please hold on ..."-sample on my website, maybe that's what
you're looking for ..?

Cheers,
Olaf [MVP]
--
My .02: www.Resources.IntuiDev.com
Nov 12 '05 #2
there is a property for the form that you open call "border style" - set it
to 'none'

cheers
paul g

"tom" <to*@nuws.com> wrote in message
news:c1**************************@posting.google.c om...
Hey All,

While running some code, I'd like to open a form as a dialog box (so
that the code will wait for the form to be closed/hidden -- easy to do
using the acDialog argument), but I would like this form to have NO
BORDER. Is this possible in any way? Can the form, upon opening, strip
off its own border?

????
-Tom

Nov 12 '05 #3
tom
Olaf,
The problem is that when you open a form as acDialog, the
BorderStyle property is ignored. Right?

-Tom
'store original state, change to 'None'
domcmd.openform _
formname:=strformname, _
view:=acdesign , _
windowmode:=achidden
lngorgstyle=forms(strformname).borderstyle
forms(strformname).borderstyle=0
docmd.close acform,strformname,acsaveyes

domcmd.openform _
formname:=strformname, _
windowmode:=acdialog

Nov 12 '05 #4
tom
Paul,

The form's BorderStyle property is ignored when opening a form as
acDialog.
And, when I attempt to set the BorderStyle property on the fly
(Me.BorderStyle = 0) in form_open, I get:
"You can't assign a value to this object. (2448)"

-Tom
there is a property for the form that you open call "border style" - set it
to 'none'

Nov 12 '05 #5
What you describe would be a non-standard interface for Windows, and to make
your applications most usable, non-standard interfaces should be used only
if there is a compelling reason to confront the user with something that is
unfamiliar.

You might be able to do what you want by getting down-and-dirty, and
subclassing the form, or by making some use of the Windows API. The best
sources I know of that kind of information are the FAQ at
http://www.mvps.org/access and MVP Stephen Lebans' site
http://www.lebans.com. I haven't had occasion to investigate this particular
need, so I can't say if it is specifically addressed.

Larry Linson
Microsoft Access MVP

"tom" <to*@nuws.com> wrote in message
news:c1**************************@posting.google.c om...
Hey All,

While running some code, I'd like to open a form as a dialog box (so
that the code will wait for the form to be closed/hidden -- easy to do
using the acDialog argument), but I would like this form to have NO
BORDER. Is this possible in any way? Can the form, upon opening, strip
off its own border?

????
-Tom

Nov 12 '05 #6
Hi,

On 20 Dec 2003 21:23:04 -0800, tom wrote:
The problem is that when you open a form as acDialog, the
BorderStyle property is ignored. Right?


sorry, Tom - I didn't take the time to try the code I wrote. You're right,
if opening the form with acdialog, it'll simply ignore the
borderstyle-property.

What are you up to do anyway? Opening a interactive form without borders
and/or the titlebar doesn't make very much sense to me ...

But anyway, there's still ways to achieve what you're trying to do using
APIs. If you own the "Access Developer's Handbook" - I recall having seen
code for i.e. removing the titlebar there. Another very good source of
information is the API-viewer that you may download from AllAPI:
www.mentalis.org/index2.shtml (second link in the green box to the left).

Cheers,
Olaf [MVP]
--
My .02: www.Resources.IntuiDev.com
Nov 12 '05 #7
yes you are right . . . i tested it . .

however . . if you set all the buttons to none the form opens up quite clean
.. . use form.caption to give it a heading . .

why do you really want it totally borderless . . . refer to larry's reply
also . . he makes a good point

cheers
paul g

"tom" <to*@nuws.com> wrote in message
news:c1**************************@posting.google.c om...
Paul,

The form's BorderStyle property is ignored when opening a form as
acDialog.
And, when I attempt to set the BorderStyle property on the fly
(Me.BorderStyle = 0) in form_open, I get:
"You can't assign a value to this object. (2448)"

-Tom
there is a property for the form that you open call "border style" - set it to 'none'

Nov 12 '05 #8
tom
> why do you really want it totally borderless . . . refer to larry's reply
also . . he makes a good point


Paul,

Thanks for the reply. Yes, WHY would I want to do this is a good
question... I have a situation where I want to have a popup form
appear, much the same way a list pops down from a combo box or a
context menu appears on right-click. I would then like to take some
action when the user closes the popup form, and, as this could be one
of many forms, I'm trying to move as much of the generalizable coding
outside the form itself. SO, being able to sit and wait for the form
to complete, as acDialog lets me, seems like a nice thing.

HOWEVER, it sure would be better if this could behave like a regular
popup and if the user clicks outside the popup it just goes away. How
does one implement that (popup forms don't seem to fire activate and
deactivate events)?

Also, I'd love suggestions for a good architecture for this,
described here in more detail:

* I have a form with a listview control (populated based on a
collection of objects, not a db table).
* When the user clicks on an item in the list, the appropriate
"handler" form pops up and lets them configure the item's underlying
object.

thanks,
-tom
Nov 12 '05 #9
How about using a form embedded in a subform control instead of a popup? How
about running the "rest of the code" in the popup's Close event? How about
living with the border? None of these may be the answer, but all might be
alternatives.

Larry Linson
Microsoft Access MVP

"tom" <to*@nuws.com> wrote in message
news:c1**************************@posting.google.c om...
why do you really want it totally borderless . . . refer to larry's reply also . . he makes a good point


Paul,

Thanks for the reply. Yes, WHY would I want to do this is a good
question... I have a situation where I want to have a popup form
appear, much the same way a list pops down from a combo box or a
context menu appears on right-click. I would then like to take some
action when the user closes the popup form, and, as this could be one
of many forms, I'm trying to move as much of the generalizable coding
outside the form itself. SO, being able to sit and wait for the form
to complete, as acDialog lets me, seems like a nice thing.

HOWEVER, it sure would be better if this could behave like a regular
popup and if the user clicks outside the popup it just goes away. How
does one implement that (popup forms don't seem to fire activate and
deactivate events)?

Also, I'd love suggestions for a good architecture for this,
described here in more detail:

* I have a form with a listview control (populated based on a
collection of objects, not a db table).
* When the user clicks on an item in the list, the appropriate
"handler" form pops up and lets them configure the item's underlying
object.

thanks,
-tom

Nov 12 '05 #10
Hi,

On 23 Dec 2003 06:26:19 -0800, tom wrote:
Thanks for the reply. Yes, WHY would I want to do this is a good
question... I have a situation where I want to have a popup form
appear, much the same way a list pops down from a combo box or a
context menu appears on right-click. I would then like to take some
action when the user closes the popup form, and, as this could be one
of many forms, I'm trying to move as much of the generalizable coding
outside the form itself. SO, being able to sit and wait for the form
to complete, as acDialog lets me, seems like a nice thing.

HOWEVER, it sure would be better if this could behave like a regular
popup and if the user clicks outside the popup it just goes away. How
does one implement that (popup forms don't seem to fire activate and
deactivate events)?
why don't you simply set the form's borderstyle (along with all other
related props) to "none", the dialog-prop to True and modal-prop to True?
This way you could simply state a [docmd.openform formname:="yourForm"] to
open the form that way. The arguments required by the form being called
could be passed using OpenArgs (i.e. seperated by semicolons, then
retrieved via Split()).
A somewhat different approach would be to create a function in a general
module or class, passing all args to that function (or properties, if a
class is being used) and the popup-form pulling these from the module's
properties. That would give you a more generally related way of retrieving
values from the popup as only the module/class and the form would
communicate with each other.

If you require positioning the form below a certain spot on the calling
form (i.e. the calling control's position) you'll have to make use of a
couple of APIs (see the "mouse-pos relative to Access-window"-sample on my
website) as, in order to calculate the control's position, you'll have to
retrieve information about the form's borderwidth, titlebar-height, etc..

But ... to me that'd only make sense if there's a single control as there
would be if you'd i.e. create your own combo-box. In that case I'd prefer
creating a user-control with VB6 and use that.
* I have a form with a listview control (populated based on a
collection of objects, not a db table).
* When the user clicks on an item in the list, the appropriate
"handler" form pops up and lets them configure the item's underlying
object.


And why does the handler-form have to called without a border? I guess most
users may be irritated as this clearly is a non-standard-situation ...

Cheers,
Olaf [MVP]
--
My .02: www.Resources.IntuiDev.com
Nov 12 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Colin Cashman | last post: by
10 posts views Thread by Guadala Harry | last post: by
6 posts views Thread by Thomas Schoch | last post: by
reply views Thread by Roger Garrett | last post: by
10 posts views Thread by Xu, Qian | last post: by
9 posts views Thread by Gord | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.