日期:2014-05-18  浏览次数:20875 次

使用 SetParent API 后 ToolStrip 失效问题
我用这两个API
VB.NET code

    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer

    Public Declare Function SetParent Lib "user32" Alias "SetParent" _
    (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

      Dim hDeskTop As IntPtr = FindWindow("Progman", "Program Manager")
      SetParent(Me.Handle, hDeskTop)
    End Sub


把窗体固定在桌面上不能最小化,打算做一个和Vista边侧栏类似的东西

之后在窗体上加上 ToolStrip 控件
结果发现 ToolStrip 点击事件失效
点击没有任何反应


怎么解决??
求高人解答!!!
谢谢!!!!!!

------解决方案--------------------
有点难度哦