Hi Grigore,
Sorry to hear you had a bad day. Here is the code to lock the screen while you refresh the controls. There isn't anything built in but you can still get the desired effect:
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
>Hello
>
>I had a very bad day today. I am trying to understand and learn VB.NET, but if anyone would ask me, I'd say it's UI interface sucks big time. Two simple questions:
>
>How can one make a label transparent? If I choose 'transparent' as back color, the form underneath it is visible (i tested that), but the other controls (such as another textbox) aren't. How this come?
>
>Is there a setting similar with LockScreen = .T.? I put three labels on a form and if I run the exe, I can see how they are drawn on form, one by one! Very fast, is true, but I still can see the process! what the hell? It can't draw three simple labels?
>
>
>Maybe one can explain what I'm missing? It's extremely frustrating for me....
>
>THank you
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi