Connecting Tech Pros Worldwide Forums | Help | Site Map

dialog box with no border? (access xp)

tom
Guest
 
Posts: n/a
#1: Nov 12 '05
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

Olaf Rabbachin
Guest
 
Posts: n/a
#2: Nov 12 '05

re: dialog box with no border? (access xp)


Hi,

On 20 Dec 2003 00:48:44 -0800, tom wrote:
[color=blue]
> 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?[/color]

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
Kinetic - Paul G
Guest
 
Posts: n/a
#3: Nov 12 '05

re: dialog box with no border? (access xp)


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

cheers
paul g

"tom" <tom@nuws.com> wrote in message
news:c17f6324.0312200048.2662d4a3@posting.google.c om...[color=blue]
> 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[/color]


tom
Guest
 
Posts: n/a
#4: Nov 12 '05

re: dialog box with no border? (access xp)


Olaf,
The problem is that when you open a form as acDialog, the
BorderStyle property is ignored. Right?

-Tom[color=blue]
> '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
>[/color]
tom
Guest
 
Posts: n/a
#5: Nov 12 '05

re: dialog box with no border? (access xp)


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
[color=blue]
> there is a property for the form that you open call "border style" - set it
> to 'none'[/color]
Larry Linson
Guest
 
Posts: n/a
#6: Nov 12 '05

re: dialog box with no border? (access xp)


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" <tom@nuws.com> wrote in message
news:c17f6324.0312200048.2662d4a3@posting.google.c om...[color=blue]
> 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[/color]


Olaf Rabbachin
Guest
 
Posts: n/a
#7: Nov 12 '05

re: dialog box with no border? (access xp)


Hi,

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

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
Kinetic - Paul G
Guest
 
Posts: n/a
#8: Nov 12 '05

re: dialog box with no border? (access xp)


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" <tom@nuws.com> wrote in message
news:c17f6324.0312202124.59e9b68d@posting.google.c om...[color=blue]
> 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
>[color=green]
> > there is a property for the form that you open call "border style" - set[/color][/color]
it[color=blue][color=green]
> > to 'none'[/color][/color]


tom
Guest
 
Posts: n/a
#9: Nov 12 '05

re: dialog box with no border? (access xp)


> why do you really want it totally borderless . . . refer to larry's reply[color=blue]
> also . . he makes a good point[/color]

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
Larry Linson
Guest
 
Posts: n/a
#10: Nov 12 '05

re: dialog box with no border? (access xp)


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" <tom@nuws.com> wrote in message
news:c17f6324.0312230626.4ff3ce78@posting.google.c om...[color=blue][color=green]
> > why do you really want it totally borderless . . . refer to larry's[/color][/color]
reply[color=blue][color=green]
> > also . . he makes a good point[/color]
>
> 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[/color]


Olaf Rabbachin
Guest
 
Posts: n/a
#11: Nov 12 '05

re: dialog box with no border? (access xp)


Hi,

On 23 Dec 2003 06:26:19 -0800, tom wrote:
[color=blue]
> 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)?[/color]

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.
[color=blue]
> * 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.[/color]

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
Closed Thread


Similar Microsoft Access / VBA bytes