Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move a Form
Message
General information
Forum:
ASP.NET
Category:
Forms
Title:
Miscellaneous
Thread ID:
00841255
Message ID:
00841308
Views:
23
This message has been marked as the solution to the initial question of the thread.
Initially I thought this was a good case for a suspendlayout - resumelayout(false) but I still got the flicker. Here is a solution that may not be exactly what you want but still looks professional. Add a timer - interval=1500. I found less than that would seem jumpy and the form would pop back on the mouse up and then jump back to the corrected position. I snipped the function signatures for aesthetics.
    Private Sub Form1_LocationChanged(...) Handles MyBase.LocationChanged
        tmrMove.Enabled = True
    End Sub

    Private Sub tmrMove_Tick(...) Handles tmrMove.Tick
        If Me.Left < 0 Then
            Me.Left = 0
            tmrMove.Enabled = False
        End If
    End Sub
>I have a MDI Parent/Child situation and I am trying to prevent my child form from moving it's left position to a negative. Same goes for the top position. I have achieved this via the following code:
>
>
>Private Sub frm_A_Users_Move(ByVal sender As Object, _
>        ByVal e As System.EventArgs) Handles MyBase.Move
>
>        Dim intLeft As Integer = Me.Left
>        Dim intTop As Integer = Me.Top
>
>        If intLeft < 0 Then Me.Left = 0
>        If intTop < 0 Then Me.Top = 0
>
>End Sub
>
>
>This works but the controls on the form will flicker when the form comes up against this boundry. How or where do I prevent this from happening?
>
>Jason
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform