以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  一个内部通讯多值字段的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=70220)

--  作者:douglas738888
--  发布时间:2015/6/17 14:19:00
--  一个内部通讯多值字段的问题

请教如下图的问题:如何在CheckedComboBox中多选后,在“用户名”的Label中同样出现多选的人名

 以下是在CheckedComboBox1的事件中的Click中设置的代码,感觉代码有问题,只能选择1人,不能选择多人到“用户名”的Label中,但不知怎样改

 

If e.Form.Controls("TextBox1").Value = Nothing Then
    Dim lst As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1")
    If lst.SelectedIndex >=0 Then
        Dim s As String = lst.SelectedItem
        e.Form.Controls("用户名").Text = s.Remove(s.IndexOf("("))  \'删除"("之后的字符
    End If
Else
    Dim lst As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1")
    If lst.SelectedIndex >=0 Then
        Dim s As String = lst.SelectedItem
        If s.Remove(s.IndexOf("("))  <> e.Form.Controls("用户名").Text Then
            If MessageBox.Show("该操作会清空记录,是否继续?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
                e.Form.Controls("TextBox1").Value = Nothing
                e.Form.Controls("TextBox3").Value = Nothing
                e.Form.Controls("用户名").Text = s.Remove(s.IndexOf("("))  \'删除"("之后的字符
            End If
        End If
    End If
End If


图片点击可在新窗口打开查看此主题相关图片如下:未标题-1.jpg
图片点击可在新窗口打开查看

--  作者:大红袍
--  发布时间:2015/6/17 15:15:00
--  

 TextChanged事件

 

Dim lst As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1")

Dim reg As new System.Text.RegularExpressions.Regex("[\\(\\)0-9]")
Dim str = reg.replace(lst.Text, "")

e.Form.Controls("用户名").Text = str


--  作者:douglas738888
--  发布时间:2015/6/17 18:48:00
--  

谢谢老师!!!!!!

 


--  作者:douglas738888
--  发布时间:2015/6/18 16:44:00
--  
请教版主,Regex("[\\(\\)0-9]")的正则表达式是什么意思,如何理解?
--  作者:Bin
--  发布时间:2015/6/18 16:44:00
--  
就是把数字和括号替换掉