|
|
导航: |
论坛 -> 移动应用开发
斑竹:flyers,iamdream |
|
作者: |
sxfgf (FC_FGF) |
★☆☆☆☆ |
-
|
普通会员 |
|
2021/12/19 23:03:34 |
标题: |
请赐教:Delphi 10.2 ListBox自定义风格后,无法选中 |
浏览:1910 |
|
加入我的收藏 |
楼主: |
我是这么: var Item: TListBoxItem; begin Item := TListBoxItem.Create(nil); Item.Parent := ListBox1; Item.Height:=130; Item.StyleLookup := 'selectgoods'; Item.StylesData['GoodsFullName'] := '中华铅笔'; Item.StylesData['GoodsSta'] := '2B'; end; 自定义风格的时候把默认带的都删除了,自己加入如图
然后,编译执行后,显示正常,就是点击某个Item时,没有被选中的(背景变灰) 的感觉。 尝试,不删除原来默认的风格里的,直接加入后自定义Item格式后,Item.StylesData['GoodsFullName']的内容不显示,请教:哪里的问题呢?
此帖子包含附件:
大小:26.6K |
----------------------------------------------
偶尔做做代码应付一下工作,却发现Delphi已成必配 |
作者: |
|
2021/12/20 2:10:45 |
1楼: |
try my sample
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
|
作者: |
|
2021/12/20 2:11:12 |
2楼: |
my sample screenshot
此帖子包含附件:
大小:73.8K |
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
|
作者: |
|
2021/12/20 6:25:38 |
3楼: |
sorry, I forgot this...
此帖子包含附件:
大小:14.0K |
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
|
作者: |
|
2021/12/20 9:06:46 |
4楼: |
new demo with animations
NO VIRUS, NO SPYWARE, NO CODE :_))))
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
|
作者: |
|
2021/12/20 9:07:04 |
5楼: |
screenshot
此帖子包含附件:
大小:45.1K |
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
|
作者: |
sxfgf (FC_FGF) |
★☆☆☆☆ |
-
|
普通会员 |
|
2021/12/20 15:30:42 |
6楼: |
emailx45,大神好!
如果时安卓下的呢?
----------------------------------------------
偶尔做做代码应付一下工作,却发现Delphi已成必配
|
作者: |
janker (janker) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2021/12/20 15:37:09 |
6楼: |
选中和不选中,不是ITEM控制的,是Listbox控制的,listbox的Style.content.selection,如果用默认的,就不要改listbox的Style,如果要改listbox的Style,最好按默认的Style的项和名称来改(项目和名称不变,只改需要的位置和颜色什么的). 还有做Style的时候,注意下HiTtest,因为拖拉控件的时候,有些控件的HiTtest=true,在Style里,默认全部=false,如果需要为true,在代码里再改
----------------------------------------------
-
|
作者: |
janker (janker) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2021/12/20 15:44:31 |
7楼: |
我的一个style: 选中为半透明灰色
此帖子包含附件:
大小:177.0K |
----------------------------------------------
-
|
作者: |
|
2021/12/20 21:37:42 |
8楼: |
my test on Android 11 - 64bits
此帖子包含附件:
大小:96.1K |
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
|
|