Changing a form picture based on combobox selection

neamah

New member
Local time
Today, 12:36
Joined
Jul 30, 2013
Messages
7
hello every one
I would like to set up a picture in the form that changes based on a combobox selection, for example if you select from combo box list "design1", a picture that have a name : design1 will appear as a background to the form
please any one help me ?

:banghead::banghead::banghead::banghead:
 
hello sir
sorry but i dont understand from ur sample
can u explain please?
 
Okay, the sampel is quiet simpl, it has a Form called "RAWDATA", with nothing but two control the first is the ComboBox, which has typed in values as Man Lost, Screen, Mouse and the other control is an Image control.. The image control is left empty..

So the code involved here is the AfterUpdate of the ComboBox,
Code:
Private Sub Combo12_AfterUpdate()
    Select Case Combo12.Value
        Case "Screen"
            Image14.Picture = Application.CurrentProject.Path & "\screen.png"
        Case "Man Lost"
            Image14.Picture = Application.CurrentProject.Path & "\samp.png"
    End Select
End Sub

Based on the selection, the appropriate picture is set to the Image control. I have edited the sample to be a little bit robust.. If you still are unable to follow, let me know what stumbles you..
 

Attachments

sir
i mean the after update event is not included in my program
bcz of that the code is not working sir
 
yes sir i now i write this code on my form
i click on combobox and then i write this code
where the com1 is the name of combobox and image1 is the name for image control and love, samp is the name of iamge that i want to display

Private Sub Com1_AfterUpdate()
Select Case Com1.Value
Case "love"
Image1.Picture = Application.CurrentProject.Path & "\love.png"
Case "samp"
Image1.Picture = Application.CurrentProject.Path & "\samp.png"
End Select
End Sub
 
There seems to be some minor problems, either upload the stripped DB or, answer questions like..

What is the Row Source, Row Source Type, Column Widths, Column Count, Bound Column of the Combo Box.

Is the event getting triggered at all?
 
i am very sorry mr pr2-eugin
may be there are some misunderstanding
i am talking about visual basic 6 language
i am very sorry i write the questions in the wrong department
 

Users who are viewing this thread

Back
Top Bottom