.Net语言 APP开发平台——Smobiler学习日志:Poplist控件在APP中的应用场景以及代码...

最前面的话:Smobiler是一个在VS环境中使用.Net语言来开发APP的开发平台,也许比Xamarin更方便

 

一、目标样式

smobiler

我们要实现上图中的效果,需要如下的操作:

1.从工具栏上的”Smobiler Components”拖动一个PopList控件到窗体界面上

smobiler

2.修改PopList控件的属性

a.Groups属性

打开集合编辑器,并点击“添加”,如图1

Text和Value中都输入需要在列表中显示的选项,如图2

在Items中添加数据,如图3

smobilersmobilersmobiler
图1图2图3
b.Selections属性

设置默认选项,需要在代码中实现

VB:
    Private Sub Button1_Click(senderAs Object, e As EventArgs)Handles Button1.Click Me.PopList1.Show() If Label8.Text.Trim().Length <= 0 Then Me.PopList1.SetSelections(Me.PopList1.Groups(0).Items(6)) End If End Sub
C#:
    private void Button1_Click(object sender, EventArgs e) { PopList1.Show(); If (Label8.Text.Trim().Length <= 0) { PopList1.SetSelections(PopList1.Groups[0].Items[0]); } }
c.MultiSelect属性

默认设置不允许多选

smobiler

d.Selected事件

在内容选择完成后的事件

事件代码:

VB:
    Private Sub PopList1_Selected(senderAs Object, e As EventArgs)Handles PopList1.Selected Me.Label8.Text = PopList1.Selection.Text End Sub
C#:
    private void PopList1_Selected(object sender, EventArgs e) { this.Label8.Text = PopList1.Selection.Text; }

3.Smobiler窗体设计界面显示效果

smobiler

二、手机效果显示

smobilersmobilersmobiler

转载于:https://www.cnblogs.com/amanda112/p/5773014.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值