Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8683241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:59:15+00:00 2026-06-12T21:59:15+00:00

My startup form is a modal security form which works fine. But, if the

  • 0

My startup form is a modal security form which works fine. But, if the user “logs out”, the security form must be displayed again as a modal dialog. This last step is where everything goes wrong. It shows the form, in front of my other forms, but it’s not modal…

First, I call a method that’s written in a module, because I have to be able to call this method from every form I want.

Public Sub CallWaiterKey()
Dim oForm As frmWaiterKey = New frmWaiterKey()
    Try
        If mWaiterKey.Length > 0 And mWaiterKeyType.Length > 0 Then

            If Convert.ToInt32(mWaiterKey) > 0 And Convert.ToInt32(mWaiterKeyType) = 2 Then
                oForm.TypeOfKey = 2
            ElseIf Convert.ToInt32(mWaiterKey) > 0 And Convert.ToInt32(mWaiterKeyType) = 1 Then
                oForm.TypeOfKey = 1
            End If
            'here it goes wrong
            oForm.ShowDialog()
        End If

    Catch ex As Exception
        MsgBox(ex)
    End Try
End Sub

When I call oForm.ShowDialog() (that’s the frmWaiterKey), it comes up but isn’t modal.
I can still click the buttons that are placed on frmMenu, the form from which I called CallWaiterKey().

Am I doing something wrong here?
Or should I make the call in an other way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:59:17+00:00Added an answer on June 12, 2026 at 9:59 pm

    (My VB sucks so ignore syntax errors)

    To achieve what you are asking, specify the hosting form.

    Public Sub CallWaiterKey(ownerForm as Form)
      Dim oForm As frmWaiterKey = New frmWaiterKey()
         ' .... 
                'here it goes wrong
                oForm.ShowDialog(ownerForm)
         ' ....
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a process which opens a form and a tray icon on startup.
My WinForms app has a simple modal login form, invoked at startup via ShowDialog().
I have a web project working fine in JBOSS with form-based auth. But when
I have a form called Form1. Its set to startup-Position = Center but when
I am showing a license form at app startup, but it should be shown
I just had an interesting experience with a startup form in MS Access 2010.
I want to know the application startup path for C# 2.0 windows form application.
I want design my startup screen with progress bar. But I don't how to
We're a startup and we built a .net website which we are porting over
How to make the startup form initially invisible or hidden I have a GUI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.