LinkButton翻译成
html
标记是
a
链接
所以只要想办法改变a链接的颜色就可以了
如果页面所有的链接都一种样式的话,用jquery:
$("a").click(function
()
{
$("a").css("color","black")
$(this).css("color",
"red")
return
false
})
还可以在样式表中设样式
方法很多的
在新建的Flex项目中的默认包中,新建一个Flex应用程序“LinkButton.mxml”,
将窗口由源代码编辑切换成设计视图,找到组件视图,直接将LinkButton控件拖到设计视图窗口,
修改LinkButton的标签和文本字体大小,
将窗口由设计视图窗口切换到源代码编辑窗口,
给LinkButton点击事件click="clickHandler(event)"
protected function clickHandler(event:MouseEvent):void
{
}
在事件函数打印结果
import mx.controls.Alert
/**
* LinkButton单击事件函数
*/
protected function clickHandler(event:MouseEvent):void
{
Alert.show(event.currentTarget.toString())
}
运行应用程序,并单击按钮
每个控件都有location属性,在你赋值的时候你可以设置linkbutton的location属性来控制它的位置this.Linkbutton1.location=new point(5,5)
this.linkbutton2.Text="3329u3djfagewf"//linkbutton赋值
this.linkbutton2.location =new point(this.linkbutton1.X+this.linkbutton1.width+3,this.linkbutton1.Y)//这里确定linkbutton2的位置,与linkbutton1的间距是3
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)