以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何引用到ToolStripDropDown里的控件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=54652)

--  作者:打错潇洒
--  发布时间:2014/8/1 14:11:00
--  如何引用到ToolStripDropDown里的控件
Dim name As String = ""
Static dropDownHost As Windows.Forms.ToolStripControlHost
Static dropDown As Windows.Forms.ToolStripDropDown
If dropDownHost Is Nothing Then
    dropDownHost = New Windows.Forms.ToolStripControlHost(Forms(e.Form.Name).Controls("Panel_列表_外").BaseControl)
    dropDown = New Windows.Forms.ToolStripDropDown
    dropDown.Items.Add(dropDownHost)
End If
\'定位-----------------------------------------------------------------
Dim point As Point = basemainform.PointToScreen(Forms(e.Form.Name).Controls(e.Sender.Name).BaseControl.Bounds.Location) \'定位主界面XY
point.Y += 180 + Forms(e.Form.Name).Controls(e.Sender.Name).Top
point.X += 30 \'Forms(e.Form.Name).Controls(e.Sender.Name).left -30
dropDown.Show(point)

Dim TableName As String = e.Form.Name & "_Table"
Dim int As Integer = Tables(TableName).Position
If int > -1 Then
    Dim str As String = Tables(TableName).Rows(int)("产品名称")
    Dim Multi As String = DataTables(TableName).SQLGetComboListString("产品配件名称","[产品名称] = \'" & str & "\'")
    dropDown.Controls("Panel_列表_外").Controls("Panel_列表_内").Controls("ListBox_列表观察").ComboList = Multi
End If

红色部分错误 怎么处理

--  作者:有点甜
--  发布时间:2014/8/1 14:36:00
--  

 回复楼主,无法使用,也无法处理。

 

 直接写 e.Form.Controls("ListBox_列表观察").ComboList = Multi

[此贴子已经被作者于2014-8-1 14:36:28编辑过]

--  作者:打错潇洒
--  发布时间:2014/8/1 14:42:00
--  
没有办法?
--  作者:有点甜
--  发布时间:2014/8/1 14:43:00
--  
以下是引用打错潇洒在2014-8-1 14:42:00的发言:
没有办法?

 

直接写,不能你这样用