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

  • Home
  • SEARCH
  • 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 8445025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:33:07+00:00 2026-06-10T09:33:07+00:00

I am making an server control application ( simple with some buttons to start/stop

  • 0

I am making an server control application ( simple with some buttons to start/stop the server )
And when the user wants to close the application there will be prompted an confirm box.

Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing

    Dim response As Integer
    response = MsgBox("Are you sure you want to stop the server", vbYesNo, "Stop Server ?")
    If response = vbYes Then
        Shell("cscript ""stop.vbs""", 1)
        Close()
    Else
        e.Cancel = True
    End If
End Sub

That is the code I have now.
But when I start the application and close it with the X button or with “Close Window” I will be prompted with the question until I click on no, then it will close.
It’s a loop and it stops when you first click on yes then on no.

Can someone help me with solving this ?

  • 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-10T09:33:09+00:00Added an answer on June 10, 2026 at 9:33 am

    Just remove the Close() call, since the Form is already closing. No need to do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in making a simple cgi server for a course. To do that in some
I'm making an application for android that communicates with a server to control it
i m making a rmi based client server application. At Server side, it consists
I am making HTTP connections to server to get some data. It works on
I'm making in house application that download data via xml files from external server.
I'm currently making the backend of an application updater and i use my server
I'm using the ASP.Net Login control to login a web application. When the user
I'm making server that make a tcp socket and work over port range, with
I m making call to server using NSURLConnection for iPhone & receiving the response
I'm making an ftp server, and when i'm trying to connect to it with

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.