zoukankan      html  css  js  c++  java
  • .Net语言 APP开发平台——Smobiler学习日志:Poplist控件的正确打开方式以及如何快速实现

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

    样式一

    一、目标样式

    smobiler

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

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

    smobiler

    2.修改PopList控件的属性

    a.Groups属性

    PopList控件显示包括两种模式:展开模式和筛选分类模式;两种模式只能选其中一种

    展开模式(本样式选用展开模式)

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

    其中包括indexerKey(分类筛选类型)、Text(菜单组文本)和Value(内部值,不在界面上显示),如图2

    在Items中添加数据,如图3

    PopList控件的手机显示效果如图4

    smobiler smobiler smobiler smobiler
    图1 图2 图3 图4

    筛选分类模式

    indexerKey(分类筛选类型)、Text(菜单组文本)和Value(内部值,不在界面上显示)的设置见图5

    在Items中添加数据,如图6

    PopList控件的手机显示效果如图7

    smobiler smobiler smobiler
    图5 图6 图7

    b.MultiSelect属性

    默认设置不允许多选

    smobiler

    c.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]);
            }
        }

    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

    二、手机效果显示

    smobiler smobiler smobiler
  • 相关阅读:
    avcodec_open2()分析
    CentOS 6.9 下安装DB2
    使用python操作mysql数据库
    python之tcp自动重连
    决策树算法
    文件夹自动同步工具
    KNN算法介绍
    go语言生成uuid
    golang之log rotate
    golang之tcp自动重连
  • 原文地址:https://www.cnblogs.com/amanda112/p/6084940.html
Copyright © 2011-2022 走看看