473,387 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 5676
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rod | last post by:
I have an asp.net application where some of the interaction with the user is through modal dialog windows. This works very well except for the annoying fact that the dialog window always returns...
4
by: Colin Cashman | last post by:
What's the best way to build a dialog where a listbox on the left side of the dialog determines which set of controls to display on the right side of the dialog (similar to VS.net's Options dialog)?
4
by: Alexander | last post by:
Hi, I have written a program that takes on some operations much more time than I expected. As I have seen users clicking wildly on the screen to make something happen, I want to follow the...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
6
by: Thomas Schoch | last post by:
I want to add a combobox to the save file dialog, where the user can choose an additional option. How can this be done in VB.NET? Thomas
0
by: Roger Garrett | last post by:
I have an MFC dialog-based application. I have overridden the OnNcPaint method and draw some images in the non-client area of the dialog. It works just fine when, for example, some other window is...
4
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes...
10
by: Xu, Qian | last post by:
Hi All, Is it possible to detect whether a (confirmation or prompt) dialog is present? And furthermore, how to press OK, Cancel buttons of a dialog? I am writing a javascript based test...
9
by: Gord | last post by:
In VB6, a custom dialog can be easily created by adding a new form, adding whatever controls you like, sizing it as you like, adding code and then just loading/unloading it whenever you like....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.