GridData.GetCellBackgroundColor

導入

v12.0 (2014)

説明

指定したセルの背景カラーを取得します。

C#構文

Color GridData.GetCellBackgroundColor( Int32 in_lCol, Int32 in_lRow );

スクリプト構文

oReturn = GridData.GetCellBackgroundColor( Column, Row );

戻り値

指定したセルの背景を描画するために使用します。Color

パラメータ

パラメータ タイプ 説明
Column Long セルの列インデックス。
Row Long セルの行インデックス。

Python の例

import win32com.client

from win32com.client import constants as C

propName = "TheProperty"

gridDataName = "TheGrid"

siProperty = Application.ActiveSceneRoot.AddProperty( "CustomProperty", False, propName ) 

gridData = siProperty.AddGridParameter(gridDataName).Value 

gridData.ColumnCount = 3

gridData.RowCount = 3

for row in range( 3 ):

	gridData.SetRowLabel( row, "Row %d"%row )

	for col in range ( 3 ):

		if row == 1:

			gridData.SetColumnLabel( col, "Col %d"%col )

		gridData.SetCell( col, row, "%d,%d"%( col, row ) )

Application.InspectObj( siProperty )

# Set third row background color to Blue

color = gridData.GetCellBackgroundColor( 0, 2 )

color.Red = 0

color.Green = 0

color.Blue = 255

for col in range(3):

	gridData.SetCellBackgroundColor( col, 2, color )

# Log the first column cell colors

for row in range(3):

	color = gridData.GetCellBackgroundColor( 0, row )

	Application.LogMessage("Color for (%d,%d) = (%d, %d, %d)"%( 0, row, color.Red, color.Green, color.Blue ) )

関連項目

GridData.SetCellBackgroundColor