1 (edited by unforgettable 2020-05-10 11:12:52)

Topic: Combobox

Hi Friend,
           Wish  of you to be saved from Corona virus.
Can any body help me in problem? Problem is I have form which has a combobox and combobox has six items suppose a,b,c,d,e,f. I have made another form where I want only three items suppose c,d,e want to show on combobox. How it will be?
Thanks in advance.

Re: Combobox

unforgettable,
You could use the ComboBox filter in the Object Inspector on your second form. See attached.

Post's attachments

Attachment icon ComboBox Filter.png 6.4 kb, 115 downloads since 2020-05-10 

Re: Combobox

Thank you ehwagner to reply. You are my teacher. You have taught much more. How can I use if then statement using an item from combobox?. For example there is item c in combobox. On selecting item c a picture must be visible?

Re: Combobox

I'm not sure if the attached is what you are looking for, but you do not need an IF statement. You can use the onChange event on the combobox to retrieve the associated image from the database.

Post's attachments

Attachment icon ImageLoad.zip 367.95 kb, 315 downloads since 2020-05-12 

Re: Combobox

Thank you ehwagner for your attached project which is an other lesson to learn but my aim was to know how to use if....then statement. For example if I select "f" from combobox then edit1 and label1 must be visible. How it will be?

6 (edited by derek 2020-05-17 12:28:18)

Re: Combobox

unforgettable,
Have a look at the attached example for some basic 'if......then.......else........ statements.
In the first example (Combobox1) I am only changing 1 thing (colour) so can simply write 'if......then   else if.....then.......else if........then.......else.
In the second example (Combobox2) I am changing many things so I need to enclose each group of changes in  'if .......then 'BEGIN......END else if.......then BEGIN......END..... etc etc.
There are slight variations on how you can write 'if.......then' statements but the basics are the same.  It perhaps looks a little complicated at first but you learn it quickly.
Derek.

Post's attachments

Attachment icon ifthen.zip 337.76 kb, 295 downloads since 2020-05-17 

Re: Combobox

Derek,
         Thank you very much. The attached project is a project that I want to know about using if then statement. Can you help me is this possible to set an image as background of a form. If yes, how is this?

Re: Combobox

Hello unforgettable, Hello Derek
To put an image as background on a form :

1 - Place an Image component
2 - Set up dimensions (width and Height)
3 - Check or uncheck Stretch property  (to respect the ratio and not to distort the appearance of the image)
4 - Click Picture property to choose your image as background
5 - In Additional, choose (or not) properties Autosize (don't if you've uncheck Stretch) and Center

Hope this can help you

JB