---
title: "滑块调节窗体透明度"
author: "itbutteye"
date: "2012-03-26T14:31:16Z"
tags: ["滑块调节窗体透明度"]
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2012-03-26T14:32:06Z"
id: 1464028
url: "https://itbutteye.iteye.com/blog/1464028"
---

```c#

private void tbOpacity_Scroll(object sender, EventArgs e)
{
    this.Opacity = (tbOpacity.Value + 1) / 11.0;
}

```


这里加1除以11.0目地有二：
1.保证当滑块调制最小时，不至于全透明，完全看不见窗体；
2.赋值必须是0.0至1.0的浮点数。