다음을 통해 공유


Section.Paint Event (Access)

Occurs when the specified section is redrawn.

Version Information

추가된 버전: Access 2007

Syntax

.Paint

A variable that represents a Section object.

Example

The following example shows how to set the BackColor property of a control based on its value.

Sample code provided by:Access 2010 프로그래머 참조 책 표지 The Microsoft Access 2010 Programmer’s Reference | About the Contributors

Private Sub SetControlFormatting()
    If (Me.AvgOfRating >= 8) Then
        Me.AvgOfRating.BackColor = vbGreen
    ElseIf (Me.AvgOfRating >= 5) Then
        Me.AvgOfRating.BackColor = vbYellow
    Else
        Me.AvgOfRating.BackColor = vbRed
    End If
End Sub

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    ' size the width of the rectangle
    Dim lngOffset As Long
    lngOffset = (Me.boxInside.Left - Me.boxOutside.Left) * 2
    Me.boxInside.Width = (Me.boxOutside.Width * (Me.AvgOfRating / 10)) - lngOffset
    
    ' do conditional formatting for the control in print preview
    SetControlFormatting
End Sub

Private Sub Detail_Paint()
    ' do conditional formatting for the control in report view
    SetControlFormatting
End Sub

About the Contributors

Wrox Press(영문일 수 있음)는 프로그래머가 프로그래머를 위해 집필한 서적을 전문으로 출판하는 업체로, 이러한 서적에서는 실제 프로그래밍 관련 문제에 대한 신뢰할 수 있는 해결 방법을 제공합니다.

참고 항목

개념

Section Object

Section Object Members