Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tabpagecontrol, binding, from refresh misery
Message
De
23/10/2011 05:12:55
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Divers
Thread ID:
01527103
Message ID:
01527126
Vues:
60
This message has been marked as a message which has helped to the initial question of the thread.
Haha, let me take a guess

The property FreezePainting() should be a property of your form. If you have subclassed the WinForm and your forms derive from that subclass - add the property to your subclass and you have it everywhere

Looking at the code, I see you can set FreezePainting = true a number of times - it holds a count : paintFrozen

Setting FreezePainting = false only unfreezes when the count paintFrozen becomes zero



>Right! Thanks....
>
>errrh .... and that code, you eat that with a fork or with a spoon :).
>
>You know how that should be implemented? As a partial class? And how should it be called?
>
>Here's that code again :
>
>
>Imports System.Drawing
>Imports System.Runtime.InteropServices
>
>Private paintFrozen As Integer
>Private Const WM_SETREDRAW As Integer = 11
>
>Property FreezePainting() As Boolean
>    Get
>
>        Return (paintFrozen > 0)
>
>    End Get
>    Set(ByVal Value As Boolean)
>
>        If ((Value AndAlso IsHandleCreated) _
>                    AndAlso Me.Visible) Then
>            If (0 = paintFrozen) Then
>                paintFrozen = paintFrozen + 1
>                SendMessage(Handle, WM_SETREDRAW, 0, 0)
>            Else
>                paintFrozen = paintFrozen + 1
>            End If
>        End If
>        If Not (Value) Then
>            If (paintFrozen = 0) Then
>                Return
>            End If
>            paintFrozen = paintFrozen - 1
>            If 0 = paintFrozen Then
>                SendMessage(Handle, WM_SETREDRAW, 1, 0)
>                Invalidate(True)
>            End If
>        End If
>
>    End Set
>End Property
>
><DllImport("User32", CharSet:=0, SetLastError:=False, ExactSpelling:=False, PreserveSig:=False, CallingConvention:=CallingConvention.Winapi)> _
>Private Shared Function SendMessage(ByVal hWnd As System.IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Boolean
>End Function
>
>
>
>
>
>>>I have a form with a tabpagecontol on it. In order to have all the fields on the different pages refreshed I found out I have to do something like
>>>
>>>       For i As Integer = 1 To Me.TpgBase1.TabPages.Count
>>>            Me.TpgBase1.SelectTab(i - 1)
>>>        Next
>>>        Me.TpgBase1.SelectTab(0)
>>>
>>>
>>>Now that gets me some ugly mickey mousing on my form, so I'm looking for a way to "freeze" the screen while I do that, but suspendlayout, resumelayout do not have any effect. Here's the full code.
>>>
>>>
>>>       Me.BestelHCRUD.Fill(Me.BestelDS.BestH, Me.obzBestel.pk)
>>>        Me.SuspendLayout()
>>>        For i As Integer = 1 To Me.TpgBase1.TabPages.Count
>>>            Me.TpgBase1.SelectTab(i - 1)
>>>        Next
>>>        Me.TpgBase1.SelectTab(0)
>>>        Me.ResumeLayout()
>>>
>>>
>>>Thanks and kind regards,
>>>
>>>Marc
>>
>>
>>Marc,
>>
>>Have a look at this old message Re: UI questions Thread #766067 Message #766090
>>It uses api
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform