Skip to main content

AccessTr.neT


Metin Kutusu Birleştirmek Ve Text Özelliği

Metin Kutusu Birleştirmek Ve Text Özelliği

#48
Aslında alttaki kodlarla oldu bişeyler lakin giftede olduğu gibi optionbuttonlar bazen çift çıkıyor msgboxtta.
Arka planı zaten yapamadım sorun değil o zaten.
Neden başka forumlara gif eklemek zorunda kalıyoruz konu taşınınca Img-cray
Hayırlı Kandiller bu arada abey.

[Resim: MTVlNzY2M2VhMTAzYWE.gif]

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
            Case acOptionButton 'OptionButton icin
                If ctl.Tag = "degistiginde" Then
                    ctl.OnGotFocus = "=ArdSec1([" & ctl.Name & "])"
                End If
            Case acCheckBox 'CheckBox icin
                If ctl.Tag = "degistiginde" Then
                    ctl.Value = False
                    ctl.OnLostFocus = "=ArdSecCik2([" & ctl.Name & "])" 'CheckBox icin
                End If
        End Select
    Next ctl

End Sub

Public Function Degisti(ctl As Control) 'TextBox ve ComboBox icin

    Me.Metin0 = Empty
   
    For Each ctl In Me.Controls
        If ctl.Tag = "degistiginde" Then
            If ctl.Name = ActiveControl.Name Then
              Me.Metin0 = ctl.Text
            End If
        End If
    Next ctl

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

Public Function ArdSec1(ctl As Control) 'OptionButton icin
  MsgBox ctl.Name
End Function

Public Function ArdSecCik2(ctl As Control) 'CheckBox icin
    ctl.Value = False
End Function
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Metin Kutusu Birleştirmek Ve Text Özelliği - Yazar: feraz - 21/03/2020, 21:59
Task