Discussions related to Visual Prolog
george123
Posts: 3
Joined: 6 Apr 2014 14:59

Inser Image to a button

Unread post by george123 »

Hello,

When i have a button how can I insert an image that i have on my desktop ?? Is there any chance to have multiple images and change button's image??

For example in Visual Basic I can do this by adding resources / File / and select the images

Then i can change the images of the button like
button1.backgroundimage = My.resources."imagename"

Can i do something like this in Visual Prolog ?

thanks
User avatar
Thomas Linder Puls
VIP Member
Posts: 1399
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Actually, I would advise you not to put images on buttons. If you look around you will notice that buttons do not have images (except in web pages and games).

But if you insist then you should use button::setImageList:

Code: Select all

predicates     setImageList : (imageList ImageList).     setImageList : (imageList ImageList, integer LeftMargin, integer TopMargin, integer RightMargin, integer BottomMargin, imageAlign Align).     % @short Set an #ImageList for the button (margins default to 0, #Align defaults to alignLeft)     % @details #ImageList can either contain a single image,     % or it can contain images corresponding to the states PBS_NORMAL, PBS_HOT, PBS_PRESSED, PBS_DISABLED, PBS_DEFAULTED and PBS_STYLUSHOT.     % #LeftMargin, #TopMargin, #RightMargin and #BottomMargin specifies additional margins around the image.     % #Align specifies the placement of the image on the button.     % @end
Regards Thomas Linder Puls
PDC
Post Reply