Foxtable(狐表)用户栏目专家坐堂 → 自定义登录窗口问题


  共有1866人关注过本帖平板打印复制链接

主题:自定义登录窗口问题

帅哥哟,离线,有人找我吗?
ZJZK2018
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:767 积分:6119 威望:0 精华:0 注册:2018/2/1 17:26:00
自定义登录窗口问题  发帖心情 Post By:2019/5/27 9:12:00 [只看该作者]

我做好了一个自定义登录窗口,发现用户名中无法用中文输入?


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20190527090843.png
图片点击可在新窗口打开查看

1、窗口AfterLoad

Dim cmd As New SQLCommand
Dim dt  As DataTable
Dim cmb  As WinForm.ComboBox = e.Form.Controls("cmbox_Name")
cmd.ConnectionName = V
cmd.CommandText = "SELECT DISTINCT Name Fro m {Users} Where 启用 = 1"
dt = cmd.ExecuteReader()
For Each dr As DataRow  In dt.Datarows
    cmb.Items.Add(dr("Name"))
Next
cmb.SelectedIndex = 0

Dim sf As String = GetConfigValue("Savepsw","")
If sf > "" Then
    Dim arr() As String = sf.Split("|")
    e.Form.Controls("chbox1").Checked = arr(0) = 1
    e.Form.Controls("cmbox_Name").Text = arr(1)
    e.Form.Controls("txt_Password").Text = arr(2)
End If

If e.Form.Controls("cmbox_Name").Text = "" OrElse e.Form.Controls("chbox1").Checked = False Then
    e.Form.Controls("txt_Password").Text = ""
End If

If e.Form.Controls("txt_Password").Text > "" Then
    e.Form.Controls("txt_Password").PasswordChar = "*"
End If

2、用户名ValueChanged

Dim nm As String = DataTables("Users").SQLGetComboListString("Name","启用 = 1")
Dim str As String = GetConfigValue("name","")
e.Form.Controls("txt_Password").Text = ""
If e.Form.Controls("cmbox_Name").Text = "" Then
    e.Form.Controls("txt_Password").Text = ""
Else
    If nm.Contains(e.Sender.Value) = False Then
        Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        e.Form.Controls("cmbox_Name").Text = ""
        Return
    Else
        If str.Contains(e.Sender.Value) = False AndAlso nm.Contains(e.Sender.Value) Then
            SaveConfigValue("name",str & "|" & e.Sender.Value)
        End If
    End If
End If

3、用户名ComboBox的Enter

e.Sender.ComboList = GetConfigValue("name","")
[此贴子已经被作者于2019/5/27 9:37:37编辑过]

 回到顶部