我做好了一个自定义登录窗口,发现用户名中无法用中文输入?
![dvubb 图片点击可在新窗口打开查看](skins/default/filetype/png.gif)
此主题相关图片如下:qq截图20190527090843.png
![dvubb 图片点击可在新窗口打开查看](UploadFile/2019-5/20195279112945079.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编辑过]