IronPython事始め

コンポーネント

ToolTipが代表に挙げられているので、これを使ってみようと思います。 継承しているクラスがControlクラスから継承していないクラスを分類する方法がないので、どこからどこまでがこのカテゴリに入るのかいまいち不明です。

1. 画面キャプチャ

マウスをボタンの上に載せると、"My button"というToolTipが表示されます。

$alt

2. サンプルコード:ボタン上へのToolTipの表示

06_form_tooltip.ipy

# coding=Shift_JIS
# IronPython Example: ToolTip
# - 
# @author: YasuhiroABE <yasu@yasundial.org>
# @see: ToolTip Class Example from MSDN API Reference
#
import clr
clr.AddReferenceByPartialName("System.Windows.Forms")
clr.AddReferenceByPartialName("System.Drawing")
import System
from System.Windows.Forms import Form
from System.Windows.Forms import Button
from System.Windows.Forms import ToolTip
from System.Drawing import Size

form = Form()
form.Size = Size(300,200)
form.Text = "Hello World!"

button = Button()
button.Text = "OK"

toolTip = ToolTip()
toolTip.AutoPopDelay = 5000
toolTip.InitialDelay = 1000
toolTip.ReshowDelay = 500
toolTip.ShowAlways = True
toolTip.SetToolTip(button, "My button")

form.Controls.Add(button)
System.Windows.Forms.Application.Run(form)

Created: 2010-03-11, Last modified: 2010-03-19

2009,2010 © Yasuhiro ABE <yasu@yasundial.org>

Valid XHTML + RDFa RDFa it (RDF/XML)!

正当なCSSです!

Creative Commons License www.yasundial.org by Yasuhiro ABE is licensed under a Creative Commons Attribution 2.1 Japan License. Permissions beyond the scope of this license may be available at http://www.yasundial.org/info/license.html.