AccessTr.neT

Tam Versiyon: Eğitim Planlama Programı
Şu anda arşiv modunu görüntülemektesiniz. Tam versiyonu görüntülemek için buraya tıklayınız.
yabancı kaynaktan kurs için hazırlanmış teacher student falan filan güzel bir örnek
form boyutlarını değiştirince control boyutlarının değiştiği bir kod eklemiştim
o kodu buradaki forma uyarlamam lazım yardımcı olabilir misiniz kod ekle derseniz burayada ekleyeyim
frmCalendar formunda her gün için textbox var bunlarda kurs alan kişilerin isimleri dersleri saatleri vs var
bu textboxda geçen kelime içeriğine göre arka plan rengini değiştirebilir miyiz
mesela içinde "UY" geçen textboxlar eğer seçili aya ait bir gün ise arkaplan rengi açıkmavi olsun gibi
PrintArray fonksiyonunun kodunu aşağıdaki gibi düzenleyebilirmisiniz
'hy Satırları arasındaki kodlar eklenecek
ben deneme amaçlı olarak kayıtlarda yer alan "BK2 AG" kullandım siz istediğinizi kullanırsınız
Private Sub PrintArray()
On Error GoTo ErrorHandler

Dim strCtlName As String
Dim i As Integer

For i = LBound(myArray) To UBound(myArray)
strCtlName = "txt" & CStr(i + 1)
Controls(strCtlName).Tag = i
Controls(strCtlName) = ""
Controls(strCtlName) = myArray(i, 2)
'hy Renk değişimi_________________________________
If myArray(i, 1) = True And InStr(myArray(i, 2), "BK2 AG") > 0 Then _
Controls(strCtlName).BackColor = RGB(255, 255, 0) Else _
Controls(strCtlName).BackColor = RGB(255, 255, 255)
'hy Renk değişimi_________________________________Bitti
Next i


ExitSub:
Exit Sub
ErrorHandler:
MsgBox "There has been an error. Please reload the form"
Resume ExitSub

End Sub
çok teşekkürler ellerinize sağlık
bir de resize olayına bakabilir misiniz şu kodu bu forma uyarlamam lazım

Public Sub SizeControls()
Dim lFWidth As Single, lFHeight As Single
Dim lLeft As Single, lTop As Single, lWidth As Single, lHeight As Single
Dim lDayLeft As Single, lDayTop As Single, lDayWidth As Single, lDayHeight As Single
Dim lWeekdayHeight As Single

Dim i As Integer, X As Integer, iT As Integer
Dim bAbbreviate As Boolean
Dim UF As Form

Const lPano As Single = 3000

    On Error Resume Next
    DoEvents
    If bHaftaAcik Then
        lWeekdayHeight = lblkw1.Width
    Else
        lWeekdayHeight = 0
    End If
    With Me
        .Painting = False
        lFWidth = .InsideWidth
        lFHeight = .InsideHeight - (.Section(acHeader).Height + .Section(acFooter).Height)
        lFHeight = lFHeight - 100

        lLeft = 50
        lTop = 50
        lWidth = IIf(bNavigasyonPanosu, lFWidth - (lPano + 50), lFWidth - 100)
        lHeight = lFHeight
        .lblBaslik.Width = lFWidth

        If TakvimTipi = enHafta Then
            lDayLeft = lLeft
            lDayTop = lTop + 205
            lDayHeight = lHeight - 250
            lDayWidth = lWidth \ 6

            For i = 1 To 42
                With Me("altfrmGun" & i)
                    Select Case i
                        Case 1 To 5
                            .Left = lLeft
                            .Top = lTop + 250
                            .Height = lDayHeight
                            With Me("lblGun" & i)
                                .Left = lLeft
                                .Top = lTop
                                .Width = lDayWidth
                                .Height = 250
                            End With
                        Case 6
                            .Left = lLeft
                            .Top = lTop + 250
                            .Height = (lHeight \ 2) - 250
                            With Me("lblGun" & i)
                                .Left = lLeft
                                .Top = lTop
                                .Width = lDayWidth
                                .Height = 250
                            End With
                        Case 7
                            .Left = Me("altfrmGun" & i - 1).Left
                            .Top = (lTop + (lHeight \ 2)) + 250
                            .Height = (lHeight \ 2) - 250
                            With Me("lblGun" & i)
                                .Left = Me("altfrmGun" & i).Left
                                .Top = Me("altfrmGun" & i).Top - 250
                                .Width = lDayWidth
                                .Height = 250
                            End With
                    End Select
                    .Width = lDayWidth
                    .Visible = (i < 8)
                End With
                lLeft = lLeft + lDayWidth
            Next i
        Else
            lDayLeft = lLeft + lWeekdayHeight
            lDayTop = lTop + 250
            lDayHeight = (lHeight - 250) / 6
            lDayWidth = (lWidth - lWeekdayHeight) / 7
            bAbbreviate = lDayWidth < 900

            For i = 1 To 6
                For X = 1 To 7
                    If i = 1 Then
                        With Me("lblGun" & X)
                            .Left = lDayLeft
                            .Top = lTop
                            .Width = lDayWidth
                            .Height = 250
                            .Caption = WeekdayName(CLng(X), bAbbreviate)
                        End With
                        lDayLeft = lDayLeft + lDayWidth
                    End If
                    With Me("altfrmGun" & X + iT)
                        .Width = lDayWidth
                        .Left = Me("lblGun" & X).Left
                        .Height = lDayHeight
                        .Top = lDayTop
                        On Error Resume Next
                        Set UF = .Form
                        Call FormBars(UF)
                        .Visible = True
                    End With
                Next X
                If bHaftaAcik Then
                    With Me("lblkw" & i)
                        .Left = lLeft + 10
                        .Top = lDayTop
                        .Height = lDayHeight
                    End With
                End If
                iT = iT + 7
                lDayTop = lDayTop + lDayHeight
            Next i
        End If
        .altfrmPano.Move lFWidth - lPano, 50, lPano, lFHeight
        .altfrmPano.Visible = bNavigasyonPanosu
        .Painting = True
        .Repaint
    End With

End Sub



bundaki gereksizleri çıkarıp forma uydurmam gerekiyor