Click here to Skip to main content
15,887,485 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: calling c dll that contains structures from VB6 Pin
Eddy Vluggen23-May-14 7:33
professionalEddy Vluggen23-May-14 7:33 
QuestionSpeech(Audio file ) To Text file in VB.Net Pin
Member 1041929722-May-14 3:35
Member 1041929722-May-14 3:35 
AnswerRe: Speech(Audio file ) To Text file in VB.Net Pin
Richard MacCutchan22-May-14 3:56
mveRichard MacCutchan22-May-14 3:56 
AnswerRe: Speech(Audio file ) To Text file in VB.Net Pin
Dave Kreskowiak22-May-14 4:18
mveDave Kreskowiak22-May-14 4:18 
QuestionDetect if a messagebox is shown Pin
dilkonika22-May-14 1:26
dilkonika22-May-14 1:26 
AnswerRe: Detect if a messagebox is shown Pin
Dave Kreskowiak22-May-14 4:17
mveDave Kreskowiak22-May-14 4:17 
GeneralRe: Detect if a messagebox is shown Pin
dilkonika22-May-14 4:46
dilkonika22-May-14 4:46 
GeneralRe: Detect if a messagebox is shown Pin
Eddy Vluggen22-May-14 9:11
professionalEddy Vluggen22-May-14 9:11 
dilkonika wrote:
How can i detect that a message box is shown so i can include a similar condition
"Detect" is a strange wording; it implies something on the background continually looking for something. You can actively verify if there's an instance of the CheckBox class on the form at that moment.

VB
Imports System.Windows.Forms
Module Module1

    Sub Main()
        Using f As New Form()
            Dim p As New Panel
            Dim c1 As New CheckBox With {.Name = "CheckBox1"}
            Dim c2 As New CheckBox With {.Name = "CheckBox2"}
            f.Controls.Add(p)
            f.Controls.Add(c1)
            p.Controls.Add(c2)

            For Each cb As CheckBox In FindAllCheckBoxes(f)
                Console.WriteLine("found {0}", cb.Name)
            Next

            'f.ShowDialog()
            Console.ReadLine()
        End Using
    End Sub

    Function FindAllCheckBoxes(FromWhere As Control) As IEnumerable(Of CheckBox)
        Dim result As New List(Of CheckBox)

        For Each c As Control In FromWhere.Controls
            If TypeOf c Is CheckBox Then
                result.Add(c) ' add the control to the result if it's a checkbox
            End If
            result.AddRange(FindAllCheckBoxes(c)) ' search the controls' children
        Next

        Return result
    End Function

End Module
Would also return invisible checkboxes that may be hiding on that form.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: Detect if a messagebox is shown Pin
dilkonika22-May-14 9:48
dilkonika22-May-14 9:48 
GeneralRe: Detect if a messagebox is shown Pin
Eddy Vluggen22-May-14 22:31
professionalEddy Vluggen22-May-14 22:31 
GeneralRe: Detect if a messagebox is shown Pin
Dave Kreskowiak22-May-14 11:11
mveDave Kreskowiak22-May-14 11:11 
GeneralRe: Detect if a messagebox is shown Pin
Dave Kreskowiak22-May-14 11:11
mveDave Kreskowiak22-May-14 11:11 
GeneralRe: Detect if a messagebox is shown Pin
dilkonika22-May-14 13:50
dilkonika22-May-14 13:50 
QuestionLoad method with file URL file location reference Pin
Member 1066669819-May-14 22:33
Member 1066669819-May-14 22:33 
AnswerRe: Load method with file URL file location reference Pin
Eddy Vluggen20-May-14 5:23
professionalEddy Vluggen20-May-14 5:23 
GeneralRe: Load method with file URL file location reference Pin
Member 1066669820-May-14 5:44
Member 1066669820-May-14 5:44 
QuestionListing Directory using FTPwebrequest and updating DB tables Pin
Sachin k Rajput 19-May-14 3:33
Sachin k Rajput 19-May-14 3:33 
QuestionVBScript: Conversion XML to Excel Pin
Member 1066669818-May-14 21:39
Member 1066669818-May-14 21:39 
AnswerRe: VBScript: Conversion XML to Excel Pin
Chris Quinn18-May-14 22:52
Chris Quinn18-May-14 22:52 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669818-May-14 23:05
Member 1066669818-May-14 23:05 
GeneralRe: VBScript: Conversion XML to Excel Pin
Chris Quinn18-May-14 23:32
Chris Quinn18-May-14 23:32 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 1:10
Member 1066669819-May-14 1:10 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 2:37
Member 1066669819-May-14 2:37 
GeneralRe: VBScript: Conversion XML to Excel Pin
Eddy Vluggen19-May-14 2:59
professionalEddy Vluggen19-May-14 2:59 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 3:10
Member 1066669819-May-14 3:10 

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.