以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请问如何取得控件的背景及文字颜色,  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=55842)

--  作者:tennis
--  发布时间:2014/8/24 18:19:00
--  请问如何取得控件的背景及文字颜色,
如题
--  作者:游
--  发布时间:2014/8/24 18:35:00
--  

BackColor

 

 

http://www.foxtable.com/help/topics/0720.htm

 

 

ForeColor

 

 

http://www.foxtable.com/help/topics/0721.htm

[此贴子已经被作者于2014-8-24 18:35:41编辑过]

--  作者:tennis
--  发布时间:2014/8/24 21:38:00
--  
谢谢回答,就不知如何得出 类似 Color.Pink 的值 不只是  A,R,G,B.
--  作者:有点甜
--  发布时间:2014/8/24 21:41:00
--  

 直接就可以获取的,比如 e.Form.Controls("TextBox1").BackColor.A

 

http://msdn.microsoft.com/zh-cn/library/system.drawing.color.aspx

 


--  作者:tennis
--  发布时间:2014/8/24 22:31:00
--  

某按键button1 我是想先取得其颜色 但是 messagebox.show(e.sender.backcolor) 会出现错误!!  


--  作者:有点甜
--  发布时间:2014/8/24 22:35:00
--  
 messagebox.show(e.sender.backcolor.Tostring)
--  作者:tennis
--  发布时间:2014/8/24 22:52:00
--  
3Q!!