Click here to Skip to main content
15,898,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSelectedPath Property Pin
JKarov7-Apr-15 4:39
JKarov7-Apr-15 4:39 
AnswerRe: SelectedPath Property Pin
Richard Andrew x647-Apr-15 5:12
professionalRichard Andrew x647-Apr-15 5:12 
GeneralRe: SelectedPath Property Pin
JKarov7-Apr-15 5:15
JKarov7-Apr-15 5:15 
QuestionRe: SelectedPath Property Pin
Richard MacCutchan7-Apr-15 5:58
mveRichard MacCutchan7-Apr-15 5:58 
AnswerRe: SelectedPath Property Pin
JKarov7-Apr-15 8:28
JKarov7-Apr-15 8:28 
GeneralRe: SelectedPath Property Pin
Richard Deeming7-Apr-15 8:52
mveRichard Deeming7-Apr-15 8:52 
GeneralRe: SelectedPath Property Pin
Richard MacCutchan7-Apr-15 8:55
mveRichard MacCutchan7-Apr-15 8:55 
QuestionMake all the controls inside a Groupbox unusable, without disabling them Pin
dilkonika6-Apr-15 17:27
dilkonika6-Apr-15 17:27 
Hello !
When a condition is true I want to make all the controls inside a groupbox not usable by users but without disabling them.
This is the code I use :
Class NW
        Inherits NativeWindow
        Public Sub New(hwnd As IntPtr)
            AssignHandle(hwnd)
        End Sub
        Const WM_NCHITTEST As Integer = &H84
        Protected Overrides Sub WndProc(ByRef m As Message)
            If m.Msg = WM_NCHITTEST Then
                Return
            End If
            MyBase.WndProc(m)
        End Sub
    End Class
Dim nwss As List(Of NW) = Nothing

Public Sub block_area(flag As Boolean)
        If flag = True AndAlso IsNothing(nwss) Then
            nwss = New List(Of NW)()
            For Each c As Control In GroupBox1.Controls
                nwss.Add(New NW(c.Handle))
            Next
        Else
            If flag = False And (Not IsNothing(nwss)) Then
                For Each nw As Object In nwss
                    nw.ReleaseHandle()
                Next
                nwss = Nothing
            End If
        End If
    End Sub

The problem is that this code works for all controls , except the TextBox and DateTimePicker. These 2 controls remain always clickable and editable.

What's wrong ?
Thank you !
AnswerRe: Make all the controls inside a Groupbox unusable, without disabling them Pin
JR2126-Apr-15 22:12
JR2126-Apr-15 22:12 
GeneralRe: Make all the controls inside a Groupbox unusable, without disabling them Pin
dilkonika7-Apr-15 6:17
dilkonika7-Apr-15 6:17 
Questiondatabase access Pin
Mshindi6-Apr-15 8:30
Mshindi6-Apr-15 8:30 
AnswerRe: database access Pin
Dave Kreskowiak6-Apr-15 8:40
mveDave Kreskowiak6-Apr-15 8:40 
QuestionDetect if any of controls inside a TableLayoutPanel is clicked Pin
dilkonika5-Apr-15 17:39
dilkonika5-Apr-15 17:39 
AnswerRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
Richard MacCutchan5-Apr-15 22:03
mveRichard MacCutchan5-Apr-15 22:03 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
dilkonika6-Apr-15 6:15
dilkonika6-Apr-15 6:15 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
Dave Kreskowiak6-Apr-15 6:32
mveDave Kreskowiak6-Apr-15 6:32 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
dilkonika6-Apr-15 6:37
dilkonika6-Apr-15 6:37 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
Dave Kreskowiak6-Apr-15 7:32
mveDave Kreskowiak6-Apr-15 7:32 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
Sascha Lefèvre6-Apr-15 6:35
professionalSascha Lefèvre6-Apr-15 6:35 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
dilkonika6-Apr-15 6:39
dilkonika6-Apr-15 6:39 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
Sascha Lefèvre6-Apr-15 6:59
professionalSascha Lefèvre6-Apr-15 6:59 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
dilkonika6-Apr-15 7:02
dilkonika6-Apr-15 7:02 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
dilkonika6-Apr-15 7:05
dilkonika6-Apr-15 7:05 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
Sascha Lefèvre6-Apr-15 7:11
professionalSascha Lefèvre6-Apr-15 7:11 
GeneralRe: Detect if any of controls inside a TableLayoutPanel is clicked Pin
dilkonika6-Apr-15 7:13
dilkonika6-Apr-15 7:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.