AccessTr.neT

Tam Versiyon: Access' Te Class Module Oluşturma
Şu anda arşiv modunu görüntülemektesiniz. Tam versiyonu görüntülemek için buraya tıklayınız.
Sayfalar: 1 2
(23/07/2023, 14:30)feraz yazdı: [ -> ]Buda class sız alternatif arşivden.


Kod:
Option Compare Database

Private Sub Form_Load()

    Dim ctl As Control
    
    For Each ctl In Me.Controls
        Select Case ctl.ControlType
            Case acTextBox, acComboBox 'TextBox ve ComboBox icin
                If ctl.Tag = "degistiginde" Then
                    ctl.OnChange = "=Degisti([" & ctl.Name & "])"
                    ctl.OnGotFocus = "=ArdRenk([" & ctl.Name & "])"
                    ctl.OnLostFocus = "=ArdRenkCik([" & ctl.Name & "])"
                End If
            Case acCommandButton 'CommandButton ve TextBox ve ComboBox icin
                If ctl.Tag = "degistiginde" Then
                    ctl.OnGotFocus = "=ArdRenk([" & ctl.Name & "])"
                    ctl.OnLostFocus = "=ArdRenkCik([" & ctl.Name & "])"
                End If

        End Select
    Next ctl

End Sub

Public Function Degisti(ctl As Control) 'TextBox ve ComboBox icin
    Me.Metin0 = ctl.Text
End Function

Public Function ArdRenk(ctl As Control) 'TextBox ve ComboBox ve CommandButton icin
    ctl.BackColor = vbGreen
End Function

Public Function ArdRenkCik(ctl As Control) 'TextBox ve ComboBox ve CommandButton icin
    ctl.BackColor = vbWhite
End Function

teşekkürler Hocam
(24/07/2023, 23:32)truhi yazdı: [ -> ]
(23/07/2023, 14:30)feraz yazdı: [ -> ]Buda class sız alternatif arşivden.


Kod:
Option Compare Database

Private Sub Form_Load()

    Dim ctl As Control
    
    For Each ctl In Me.Controls
        Select Case ctl.ControlType
            Case acTextBox, acComboBox 'TextBox ve ComboBox icin
                If ctl.Tag = "degistiginde" Then
                    ctl.OnChange = "=Degisti([" & ctl.Name & "])"
                    ctl.OnGotFocus = "=ArdRenk([" & ctl.Name & "])"
                    ctl.OnLostFocus = "=ArdRenkCik([" & ctl.Name & "])"
                End If
            Case acCommandButton 'CommandButton ve TextBox ve ComboBox icin
                If ctl.Tag = "degistiginde" Then
                    ctl.OnGotFocus = "=ArdRenk([" & ctl.Name & "])"
                    ctl.OnLostFocus = "=ArdRenkCik([" & ctl.Name & "])"
                End If

        End Select
    Next ctl

End Sub

Public Function Degisti(ctl As Control) 'TextBox ve ComboBox icin
    Me.Metin0 = ctl.Text
End Function

Public Function ArdRenk(ctl As Control) 'TextBox ve ComboBox ve CommandButton icin
    ctl.BackColor = vbGreen
End Function

Public Function ArdRenkCik(ctl As Control) 'TextBox ve ComboBox ve CommandButton icin
    ctl.BackColor = vbWhite
End Function

teşekkürler Hocam

Rica ederim.
Sayfalar: 1 2