Smobiler上海石磨_.NET移动开发平台

标题: Smobiler平台上如何实现类似Commbox下拉选择效果? [打印本页]

作者: vicky    时间: 2016-1-12 19:04
标题: Smobiler平台上如何实现类似Commbox下拉选择效果?
如题,如何实现类似Commbox下拉选择效果?
作者: vicky    时间: 2016-1-12 19:13
可以使用PopList来进行选择。
效果界面如下图所示:
[attach]452[/attach]

第一步:在工具箱中选择PopList拖拽到界面,因为PopList是组件,在组件栏显示
[attach]453[/attach]

第二步:PopList组件需要有按钮或者其他控件来对它进行调用。比如我们拖入一个button按钮,在在button的click事件中直接写this.poplist1.show()或者this.poplist1.showdialog()即可。
[attach]454[/attach]

第三步:可以通过设计器或在代码中添加PopList中的内容
[attach]455[/attach]
注:PopList的MultiSelect属性设置为true时,可进行多项选择。








作者: Lincy.Lin    时间: 2016-5-23 10:07
poplist给lable控件赋值,如下
  1. private void PopList1_Selected(object sender, EventArgs e)
  2.         {
  3.             try
  4.             {
  5.                 //单项选择lable控件赋值
  6.                 if (PopList1.Selection != null)
  7.                 {
  8.                     this.Label1.Text = PopList1.Selection.Text;
  9.                 }
  10.                 //多项选择lable控件赋值
  11.                 //if (PopList1.Selections != null)
  12.                 //{
  13.                 //    foreach (PopListItem poitem in PopList1.Selections)
  14.                 //    {

  15.                 //        this.Label1.Text = poitem.Text ;
  16.                 //    }
  17.                 //}
  18.             }
  19.             catch (Exception ex)
  20.             {
  21.                 MessageBox.Show(ex.Message);
  22.             }
  23.         }
复制代码







欢迎光临 Smobiler上海石磨_.NET移动开发平台 (https://www.smobiler.com/) Powered by Discuz! X3.2