/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
use a variable to declare an object
Fra : Ini


Dato : 04-02-04 10:16


Hi,

On a form I put 25 images. Depending on an action one of the images has to
become visible.

ImageXX.Visible = True

Every action gives me a number corresponding with te image that must get
visible, like:

14 --> Image14.Visible = True
17 --> Image15.Visible = True
etc.

Now I wonder if there's a smart way to writ code to make an image visible,
like:

Result = 14
ImageResult.Visible = True

I tried this one and several others in syntax but they don't work.

Anyone an idea?

Thanks,

Ini




 
 
Peter Lykkegaard (04-02-2004)
Kommentar
Fra : Peter Lykkegaard


Dato : 04-02-04 12:57


"Ini" <ini@ini.myweb.nl> wrote in message
news:bvqd8n$dor$1@news4.tilbu1.nb.home.nl...
>
> Every action gives me a number corresponding with te image that must get
> visible, like:
>
> 14 --> Image14.Visible = True
> 17 --> Image15.Visible = True
> etc.
>
Take a look at control arrays

- Peter



Steen Alcor (06-02-2004)
Kommentar
Fra : Steen Alcor


Dato : 06-02-04 09:46

Hi

Try this

Private Sub ShowImage(lngX As Long)
Dim imgTemp As Image
For Each imgTemp In Me
imgTemp.Visible = False
If imgTemp.Name = "Image" & lngX Then imgTemp.Visible = True
Next imgTemp
End Sub


"Ini" <ini@ini.myweb.nl> skrev i en meddelelse
news:bvqd8n$dor$1@news4.tilbu1.nb.home.nl...
>
> Hi,
>
> On a form I put 25 images. Depending on an action one of the images has to
> become visible.
>
> ImageXX.Visible = True
>
> Every action gives me a number corresponding with te image that must get
> visible, like:
>
> 14 --> Image14.Visible = True
> 17 --> Image15.Visible = True
> etc.
>
> Now I wonder if there's a smart way to writ code to make an image visible,
> like:
>
> Result = 14
> ImageResult.Visible = True
>
> I tried this one and several others in syntax but they don't work.
>
> Anyone an idea?
>
> Thanks,
>
> Ini
>
>
>



Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408876
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste