Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using variables to point to other variable
Message
 
À
01/11/2012 13:36:51
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01556216
Message ID:
01556285
Vues:
69
Hello : Thanks for your clarifying for me.

Iam Studying how to set propierties to object using references.
The sample code with VB.NET is :
' Sample of code, set backcolor to TextBox3, using reference :
' Command buttom code
      ' Set BackColor to TextBox3 trought reference 
        Dim tb As TextBox = DirectCast(GetReference("textbox3"), TextBox)
        ' Acces to propierty
          tb.BackColor = Color.Azure
Private Function GetReference(ByVal nombreControl As String) As Control
        For Each ctrl As Control In Me.Controls

            If ctrl.Name.ToLower = nombreControl.ToLower Then
                ' Devolvemos la referencia y abandonamos la función
                Return ctrl
            End If

        Next
        Return Nothing
    End Function
From VFP I can make this task with only one line of code using & and ..& , with VB.NET i must be write 600% more of code line to make the same task. While I understand the philosophy of desing and programming for C# AND VB.NET, every day I surprised the power of VFP to write solutions
* FoxPro Sample how to change the backcolor for a textbox1
MiVar1='TextBox1'
THISFORM.&MiVar1..Backcolor=RGB(0,0,0)
regards!
- On the Road
In circle of Life
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform