duilb常用xml

本文详细介绍了Duilib中Edit控件的边框设置方法,包括通过背景图和边框颜色进行定制。同时,深入探讨了CComboUI控件的配置,展示了如何添加多种格式选项并设置其可见性。此外,还分享了导航栏和窗体布局的XML配置实例,为Duilib开发者提供了实用的代码片段。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考:Duilib总结与心得 简书

Edit的边框两种设置方法
  • 设置背景图
bkimage="res='search_bg.png' corner='6,6,6,6'"
  • 设置边框颜色
bordersize="1" bkcolor="#FFFFFFFF" bordercolor="#FF4EA0D1"

Button背景图:

hotimage="res='button_hover.png' corner='6,6,6,6'" pushedimage="res='button_pushed' corner='6,6,6,6'"
duilib-combo
CComboUI  *m_cmbConverTo;

m_cmbConverTo = static_cast<CComboUI*>(m_PaintManager.FindControl(_T("cmbConverTo")));


pElementCtrl = new CListLabelElementUI; pElementCtrl->SetText(".MP4");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".3GP");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".MPG");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".AVI");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".WMV");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".FLV");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".SWF");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".TGA");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".MP3");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".WMA");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".AMR");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".OGG");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".AAC");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
pElementCtrl = new CListLabelElementUI;	pElementCtrl->SetText(".WAV");
m_cmbConverTo->Add(pElementCtrl);	pElementCtrl->SetInternVisible(true);
//根据配置设置文本
if ( g_config->nDownMode==1 ) {
	m_cmbConverTo->SelectItem(1);
}else{
	m_cmbConverTo->SelectItem(0);
}
导航栏与窗体
<!--导航栏-->
<HorizontalLayout height="113" bkcolor="#FF267FFC" bkcolor2="#FF0782FB">
    <HorizontalLayout width="920">
        <Option name="AdSafe1"  text="净网首页" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option1m.png' dest='36,36,76,76'"   hotimage="file='Option\Option1w.png' dest='36,36,76,76'" pushedimage="file='Option\Option1w.png' dest='36,36,76,76'" selectedimage="file='Option\Option1w.png' dest='36,36,76,76'" group="AdSafeOption" selected="true"/>
        <Option name="AdSafe2"  text="深度优化" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option2m.png' dest='36,36,76,76'"   hotimage="file='Option\Option2w.png' dest='36,36,76,76'" pushedimage="file='Option\Option2w.png' dest='36,36,76,76'" selectedimage="file='Option\Option2w.png' dest='36,36,76,76'" group="AdSafeOption" />
        <Option name="AdSafe3"  text="弹窗抓取" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option3m.png' dest='36,36,76,76'"   hotimage="file='Option\Option3w.png' dest='36,36,76,76'" pushedimage="file='Option\Option3w.png' dest='36,36,76,76'" selectedimage="file='Option\Option3w.png' dest='36,36,76,76'" group="AdSafeOption" />
        <Option name="AdSafe4"  text="拦截记录" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option4m.png' dest='36,36,76,76'"   hotimage="file='Option\Option4w.png' dest='36,36,76,76'" pushedimage="file='Option\Option4w.png' dest='36,36,76,76'" selectedimage="file='Option\Option4w.png' dest='36,36,76,76'" group="AdSafeOption" />
        <Option name="AdSafe5"  text="移动净网版" align="right" textcolor="#FFFFFFFF" font="1" textpadding="0,0,20,0" normalimage="file='Option\Option5m.png' dest='32,36,62,76'"   hotimage="file='Option\Option5w.png' dest='32,36,62,76'" pushedimage="file='Option\Option5w.png' dest='32,36,62,76'" selectedimage="file='Option\Option5w.png' dest='32,36,62,76'" group="AdSafeOption" />
    </HorizontalLayout>
    <HorizontalLayout />
</HorizontalLayout>
<!--窗体-->
<TabLayout name="AdSafeContent" bkcolor="#FFFFFFFF">
    <!-- <ChildLayout xmlfile="PageOne.xml" />
    <ChildLayout xmlfile="PageTwo.xml" />
    <ChildLayout xmlfile="PageThree.xml" />
    <ChildLayout xmlfile="PageFour.xml" />
    <ChildLayout xmlfile="PageFive.xml" /> -->
    <Include source="PageOne.xml" />
    <Include source="PageTwo.xml" />
    <Include source="PageThree.xml" />
    <Include source="PageFour.xml" /> 
    <Include source="PageFive.xml" />
</TabLayout>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

asmcvc

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值