Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can this be interpreted as a bug?
Message
De
29/05/2006 11:43:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/05/2006 11:37:48
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01125597
Message ID:
01125680
Vues:
28
>>No they are not equivalant. I tried to write some code in VB showing that they're not but my VB is simply none. Sorry for the ugly code:
>
>This is an example of how I did it:
>
>
>                ' If the control is an image
>                If TypeOf loControl Is System.Web.UI.WebControls.Image Then
>
>                    ' If the control is an imagemap
>                    If TypeOf loControl Is System.Web.UI.WebControls.ImageMap Then
>                        loControlImageMap = CType(loControl, System.Web.UI.WebControls.ImageMap)
>                        loControlImageMap.ImageUrl = oApp.cLanguage + "/" + loControlImageMap.ImageUrl
>                    Else
>                        loControlImage = CType(loControl, System.Web.UI.WebControls.Image)
>                        loControlImage.ImageUrl = oApp.cLanguage + "/" + loControlImage.ImageUrl
>                    End If
>
>                End If
>
Michel,
I think it would be better if you use GetType() instead.
For example your code would hit "else" part if that's an ImageButton ( is Image true, is ImageMap false ). If you do it like this then you need to have an if block for every derived type from Image (and for those ones that might be introduced in next version).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform