Picture on a command button....?

There is a command button on the customer card which brings up a comment table for the current customer.

When there are no lines on the comment table for the current customer, then the command button has an image of a pencil on it. When there are lines on the comment table for the current customer, then the command button has an image of a pencil with lines (indicating that there are comments on the comment table for this customer).

I’m developing a similar command button for a similar process but cannot find how to:

  • impose the images on my command button.

  • detect whether there are lines on the comment table to decide which image to show on the command button.

I’ve traced the code when you switch from one customer to another and I don’t see where the check for comment lines is made and how these images get planted on the command button.

Can anyone reveal the mystery?

Tks,

Joe

Open the Customer Card form in design mode. Move the comment button to the right. There is a picturebox right underneath it. Check out the BitmapList and SourceExpr properties. See if you can figure it out from there [H]

It’s actually two controls. One image, and one button. The image just sits on top of the button. If you design the Customer Card, then move one of the controls out of the way you’ll see it. The start examining the properties on those controls. They rely on the Comment flow field in the Customer table and a couple of bitmaps within the NAV executables.

Start there and let us know if you have questions.

Matt,

Thank you for getting me on track. All is well except when I move the two controls on top of each other (it doesn’t matter which I put on top of which), when I run the form and I click on the command button (duo) it doesn’t present the comment table. When I place separate the two and click on the command button, the comment table springs forth…hmmmm?

I looked at the original setup and when I place the command button over the top of the ‘picture box’ control, it appears to stay there. This new setup almost makes the ‘picture box’ take presedence over the command button when I put them over each other.

twisted!

You got to the hardest part, and probably most confusing. Click the picture box, then click Format → Send to Back. You may have to play with it a little bit. Essentially the image is on top of the button, and you are clicking the image instead of the button. You have to send the image to the back so that it will still display, but not get clicked on.

I see what you’re saying and it makes sense, but…there is no ‘format’ property on the ‘picture box’…you did mean click on the ‘Picutre Box’ properties, right?

The funny thing is that I copy the working model from the ‘0’ tab of the customer card form and have copied it to the ‘4’ tab of the customer card form. I made a few adjustments to the ‘duo’ on tab 4 so that the proper table elments would be brought up when clicked…which works perfectly until I combine it with the ‘picture box’…

I looked for anything that might relate to the specific tab and no luck.

side note - we are running version 4.0 ddoes that make any difference? The mechanism works because I have a model to replicate. The replicant however, does not want to perform…!

bring to front or send to back are on the format MENU, it’s not a property. When the button and picturebox are on top of eachother you can’t really tell which one is which. Just click on it and see what it is by looking at the property screen, it’ll tell you which control is selected. If it’s the picturebox, you select ‘send to back’ from the format menu, and if it’s the button, select ‘bring to front’. The button should be on top of the picturebox. Play with it until you get it right.

By the way, the tab that they are on has nothing to do with its behavior, as long as both the button and the picturebox are on the same tab of course.

Ohhhhhh the menu bar up abovvvvvvvvvvvvvve!!! Got it!!!

Thanks for sticking with me you guys! Much appreciated!!

Joe

I love watching the quarter drop [Y]

Glad you made that work Joe, and we’re always happy to help out