# SUIScrollbar

**成员** 10

|      |                                       |                                                                               |
| ---- | ------------------------------------- | ----------------------------------------------------------------------------- |
| 函数 | [OnValueChanged](#onvaluechanged)     | Handling for when the scrollbar value is changed.                             |
| 属性 | [Size](#size)                         | The size of the scrollbar handle where 1 means it fills the entire scrollbar. |
| 属性 | [Value](#value)                       | The current value of the scrollbar, between 0 and 1.                          |
| 属性 | [NumberOfSteps](#numberofsteps)       | –                                                                             |
| 属性 | [NormalColor](#normalcolor)           | –                                                                             |
| 属性 | [HighlightedColor](#highlightedcolor) | –                                                                             |
| 属性 | [PressedColor](#pressedcolor)         | –                                                                             |
| 属性 | [DisabledColor](#disabledcolor)       | –                                                                             |
| 属性 | [ColorMultiplier](#colormultiplier)   | –                                                                             |
| 属性 | [GameObject](#gameobject)             | –                                                                             |

### OnValueChanged

void OnValueChanged(Closure callback)

Handling for when the scrollbar value is changed.

参数

| 名称     | 类型    | 默认值 |
| -------- | ------- | ------ |
| callback | Closure | –      |

返回值

`void`

示例

**Lua**

```lua
function OCV()
--
end
Space.Host.ExecutingObject.UIScrollbar.OnValueChanged(OCV)

```

## 属性

### Size

float Size {get; set; }

The size of the scrollbar handle where 1 means it fills the entire scrollbar.

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.Size = 0.1

```

### Value

float Value {get; set; }

The current value of the scrollbar, between 0 and 1.

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.Value = 0.5

```

### NumberOfSteps

int NumberOfSteps {get; set; }

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.NumberOfSteps = 2

```

### NormalColor

[SColor](/docs/zh-Hans/scripting/client-scripting-api-reference/types/scolor.md) NormalColor {get; set; }

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.NormalColor = Color.Red

```

### HighlightedColor

[SColor](/docs/zh-Hans/scripting/client-scripting-api-reference/types/scolor.md) HighlightedColor {get; set; }

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.HighlightedColor = Color.Red

```

### PressedColor

[SColor](/docs/zh-Hans/scripting/client-scripting-api-reference/types/scolor.md) PressedColor {get; set; }

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.PressedColor = Color.Red

```

### DisabledColor

[SColor](/docs/zh-Hans/scripting/client-scripting-api-reference/types/scolor.md) DisabledColor {get; set; }

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.DisabledColor = Color.Red

```

### ColorMultiplier

float ColorMultiplier {get; set; }

示例

**Lua**

```lua
Space.Host.ExecutingObject.UIScrollbar.ColorMultiplier = Color.Red

```

### GameObject

[SGameObject](/docs/zh-Hans/scripting/client-scripting-api-reference/types/sgameobject.md) GameObject {get; }

示例

**Lua**

```lua
theGameObject = Space.Host.ExecutingObject.UIScrollbar.GameObject

```
