Popup and Item Image

  • Thread starter Thread starter Alessandro Baraldi
  • Start date Start date
A

Alessandro Baraldi

On a Popup Menù i can change Icon using FaceId property at runtime.

I can use only the Standard System Icon(about some Thousand).

My question, probably is silly....

Can i change the Icon(Runtime) using my BMP image...?

Thanks
@Alex
 
do you really need to change it at runtime?

You can cut/paste (and even edit) a menu icon. I use Lots of custom icons in
my applications.

You can see menu here for example

http://www.kallal.ca/ridestutorialp/drivers.htm


So, it is easy to use/place your own icons in your application. This assumes
you building custom menus here, and not using the built in ones.

I also have some good tips here (and more screen shots) of using menus in
ms-access

http://www.members.shaw.ca/AlbertKallal/Articles/UseAbility/UserFriendly.htm
My question, probably is silly....
Can i change the Icon(Runtime) using my BMP image...?

Yes, you can, but do you need to? You can well setup the icon in a menu, and
it will remain as is. I don't really see much the need to change the actual
icon, but yes...you can....

Off the top of my memory, it somitng like

CommandBars("menu bar").Controls("records").Controls("refresh").Image =
loadPicture("c:\path to bmp")

The above would be sub-menu menu ref of a main menu bar called "menu bar",
and then under the "reocrds" menu, we have a buttion called "refresh"
 
Albert D. Kallal ha scritto:
do you really need to change it at runtime?

You can cut/paste (and even edit) a menu icon. I use Lots of custom iconsin
my applications.

You can see menu here for example

http://www.kallal.ca/ridestutorialp/drivers.htm


So, it is easy to use/place your own icons in your application. This assumes
you building custom menus here, and not using the built in ones.

I also have some good tips here (and more screen shots) of using menus in
ms-access

http://www.members.shaw.ca/AlbertKallal/Articles/UseAbility/UserFriendly.htm


Yes, you can, but do you need to? You can well setup the icon in a menu, and
it will remain as is. I don't really see much the need to change the actual
icon, but yes...you can....

Off the top of my memory, it somitng like

CommandBars("menu bar").Controls("records").Controls("refresh").Image =
loadPicture("c:\path to bmp")

The above would be sub-menu menu ref of a main menu bar called "menu bar",
and then under the "reocrds" menu, we have a buttion called "refresh"

Hi Albert.
First Thanks for replay.

I need to change Runtime absolutly because mine menù are Temp
menù...!

If you have some minutes look at this Demo to generate my Popup
Runtime:

http://www.alessandrobaraldi.it/DettaglioFaq.asp?IdFAQ=103

The XP version is the Full version [Forms_PopupRuntime_2_XP.mdb] ...!

The API LoadPicture solution probably is the only Way to solve the
problem, i need to integrate on my basCode...!

Thanks for a good idea i will try immediatly.

@Alex
 
Alessandro Baraldi ha scritto:

[CUT][CUT]


I Find only Picture property, not Image... is right ?

Sub ChangeButtonImage()
Dim picPicture As IPictureDisp
Dim picMask As IPictureDisp

Set picPicture = stdole.StdFunctions.LoadPicture( _
"c:\images\picture.bmp")
Set picMask = stdole.StdFunctions.LoadPicture( _
"c:\images\mask.bmp")

'Reference the first button on the first command bar
'using a With...End With block.
With Application.CommandBars.FindControl(msoControlButton)
'Change the button image.
.Picture = picButton

'Use the second image to define the area of the
'button that should be transparent.
.Mask = picMask
End With
End Sub


@Alex
 
Albert D. Kallal ha scritto:
do you really need to change it at runtime?

You can cut/paste (and even edit) a menu icon. I use Lots of custom icons
in
my applications.

You can see menu here for example

http://www.kallal.ca/ridestutorialp/drivers.htm


So, it is easy to use/place your own icons in your application. This
assumes
you building custom menus here, and not using the built in ones.

I also have some good tips here (and more screen shots) of using menus in
ms-access

http://www.members.shaw.ca/AlbertKallal/Articles/UseAbility/UserFriendly.htm


Yes, you can, but do you need to? You can well setup the icon in a menu,
and
it will remain as is. I don't really see much the need to change the
actual
icon, but yes...you can....

Off the top of my memory, it somitng like

CommandBars("menu bar").Controls("records").Controls("refresh").Image
=
loadPicture("c:\path to bmp")

The above would be sub-menu menu ref of a main menu bar called "menu bar",
and then under the "reocrds" menu, we have a buttion called "refresh"

Hi Albert.
First Thanks for replay.

I need to change Runtime absolutly because mine menù are Temp
menù...!

If you have some minutes look at this Demo to generate my Popup
Runtime:

http://www.alessandrobaraldi.it/DettaglioFaq.asp?IdFAQ=103

The XP version is the Full version [Forms_PopupRuntime_2_XP.mdb] ...!

The API LoadPicture solution probably is the only Way to solve the
problem, i need to integrate on my basCode...!

Thanks for a good idea i will try immediatly.

@Alex
 
I need to change Runtime absolutly because mine menù are Temp
menù...!


No, the fact that you need to create some menus that travel with the
application, and belong to a particular form does NOT requite that you use
code, or use temp menus.

Unless those menus are going to change for the ONE form, then I see little,
if any advantage to using code to generate the menu.

If you build a custom menu (using the mouse + drag and drop), then that menu
WILL REMAIN with your application, and not touch, or change the ms-access
built in menus.

If you have some minutes look at this Demo to generate my Popup
Runtime:

http://www.alessandrobaraldi.it/DettaglioFaq.asp?IdFAQ=103

yes, but why use code to build a menu that you can make with the mouse?
Remember, that custom menu you build stays with the access appcation, not
ms-access.
The API LoadPicture solution probably is the only Way to solve the
problem, i need to integrate on my basCode...!

You don't need a api here. Your other post mentioned the picture property of
a menu button. You are correct, the following code does work:


CommandBars("test1").Controls("testb").Picture =
LoadPicture("c:\peoplesmall.bmp")


So, your don't need a api. further, as mentioned, if you build a custom menu
with the mouse, and in the forms "other" property, you can have that menu
bar load with the form. You can do ALL OF THIS without writing one line of
code. Further, you can set the image of the menu also, and again not have to
use code. You can also make right-click context menus for a form, and again,
you don't nee to write code to do this.

I mean, you *can* write code to build a form, but it is difficult, and most
of us use the mouse to build a form and save it. The same idea applies to
custom menus, and you can build them with the mouse, and using code is not
normally needed.

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

Note how in the above sample that the menus for each form *change* for each
form loaded, but again, NO CODE was needed...
 
Albert D. Kallal ha scritto:
No, the fact that you need to create some menus that travel with the
application, and belong to a particular form does NOT requite that you use
code, or use temp menus.

Unless those menus are going to change for the ONE form, then I see little,
if any advantage to using code to generate the menu.

If you build a custom menu (using the mouse + drag and drop), then that menu
WILL REMAIN with your application, and not touch, or change the ms-access
built in menus.


Runtime:

http://www.alessandrobaraldi.it/DettaglioFaq.asp?IdFAQ=103

yes, but why use code to build a menu that you can make with the mouse?
Remember, that custom menu you build stays with the access appcation, not
ms-access.

[Repaly]
This menù are Popup Menù wich have the property Temporary:=True.
So when i close my application they will be destroyed like a
CustomBuilt menù.
More than this, i use always the same Menù Bar in all my forms,
because if Exist
i Destroy it and rebuilt it....!

If i use a CustomBuiltMenu, i need to do a strong role validation, so
Enable, Disable
check the proper Items for each User Level.

So it's the same, but i do it Runtime, with only 1 Menù....!
By the way it's simple my opinion to solve a tecnical empasse..

So you now that Access can't have a custom Menù on Form like VB....
good, this way it's a workAround to do this.

problem, i need to integrate on my basCode...!

You don't need a api here. Your other post mentioned the picture propertyof
a menu button. You are correct, the following code does work:


CommandBars("test1").Controls("testb").Picture =
LoadPicture("c:\peoplesmall.bmp")


So, your don't need a api. further, as mentioned, if you build a custom menu
with the mouse, and in the forms "other" property, you can have that menu
bar load with the form. You can do ALL OF THIS without writing one line of
code. Further, you can set the image of the menu also, and again not haveto
use code. You can also make right-click context menus for a form, and again,
you don't nee to write code to do this.

[Replay]
StdOle library reference... so goog..!
I mean, you *can* write code to build a form, but it is difficult, and most
of us use the mouse to build a form and save it. The same idea applies to
custom menus, and you can build them with the mouse, and using code is not
normally needed.

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

[Replay]
In this case you don't have any Users, only ONE, so no permission are
needed and no different action are allowed....
Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

Note how in the above sample that the menus for each form *change* for each
form loaded, but again, NO CODE was needed...

I agree also for this solution, it's quite different way for MultiUsers
gestion and for
for a logical flow.
Less code is always better....
;-)

Thanks Albert for your Time.

@Alex from Italy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top