Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
UltraToolbarsDockArea.OnMouseUp error
posted

Hi, I write this code:

 

 Public Class myForm

        Inherits System.Windows.Forms.Form

        Private _pictureBox As Infragistics.Win.UltraWinEditors.UltraPictureBox = Nothing

        Private _borderStyle As Windows.Forms.FormBorderStyle = Nothing

        Public Sub myDisattiva(ByVal obj As Infragistics.Win.UltraWinToolbars.UltraToolbarsManager)

            If IsNothing(_pictureBox) Then

                _pictureBox = New Infragistics.Win.UltraWinEditors.UltraPictureBox

                _pictureBox.Name = "pcbDisattiva"

                _pictureBox.BorderShadowColor = System.Drawing.Color.Empty

                _pictureBox.Location = New System.Drawing.Point(0, 0)

                _pictureBox.Size = New System.Drawing.Size(100, 50)

                _pictureBox.Dock = DockStyle.Fill

                Me.Controls.Add(_pictureBox)

            End If

            Dim bmpScreenshot As New Bitmap(Me.Width, Me.Height)

            Me.DrawToBitmap(bmpScreenshot, New Rectangle(0, 0, Me.Width, Me.Height))

            Dim gfxScreenshot As Graphics = Graphics.FromImage(bmpScreenshot)

            gfxScreenshot.FillRectangle(New TextureBrush(My.Resources.Deactivate, Drawing2D.WrapMode.Tile), New Rectangle(0, 0, bmpScreenshot.Width, bmpScreenshot.Height))

            gfxScreenshot.Dispose()

            _pictureBox.Image = bmpScreenshot

            _pictureBox.Visible = True

            _pictureBox.BringToFront()


            _borderStyle = Me.FormBorderStyle

            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None

            obj.DockWithinContainer = Nothing

        End Sub

        Public Sub myAttiva(ByVal obj As Infragistics.Win.UltraWinToolbars.UltraToolbarsManager)

            If Not IsNothing(_pictureBox) AndAlso _

               _pictureBox.Visible Then

                obj.DockWithinContainer = Me

                Me.FormBorderStyle = _borderStyle

                _pictureBox.Visible = False

            End If

        End Sub

    End Class

This class creates an UltraPictureBox docked to the form and it draws an image. The image is a screenshot of the form with a texturebrushes. The effect is similar to "modal windows" of JQuery.

When I click on a buttontool (in a tabgroup on UltraToolbarsManager) the application generate UltraToolbarsDockArea.OnMouseUp error.

I suppose that the trouble is "obj.DockWithinContainer = Nothing". I use it to dock an object in front of UltraToolbarsManager.

What can I do?