Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Exit statment in visual C#

Exit statment in visual C#

Scheduled Pinned Locked Moved C#
csharphelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hemant Mane
    wrote on last edited by
    #1

    Hi friends I have a problem. I have a login form in visual C# in which user must enter username amd password and then click login. If username or password is blank then one messegebox display that "Please enter username and password". After that i want to exit that sub. In Visual besic .Net there is command "EXIT SUB". In visual C# there is a static method call Application.exit but it is for close the whole application but i want only to exit the event and application should not be close. Please reply me as early as possible Thank you. (Hemant Uttam Mane) :)

    A S 2 Replies Last reply
    0
    • H Hemant Mane

      Hi friends I have a problem. I have a login form in visual C# in which user must enter username amd password and then click login. If username or password is blank then one messegebox display that "Please enter username and password". After that i want to exit that sub. In Visual besic .Net there is command "EXIT SUB". In visual C# there is a static method call Application.exit but it is for close the whole application but i want only to exit the event and application should not be close. Please reply me as early as possible Thank you. (Hemant Uttam Mane) :)

      A Offline
      A Offline
      A Wegierski
      wrote on last edited by
      #2

      Application.Exit() static method. See help Hi, AW

      H 1 Reply Last reply
      0
      • H Hemant Mane

        Hi friends I have a problem. I have a login form in visual C# in which user must enter username amd password and then click login. If username or password is blank then one messegebox display that "Please enter username and password". After that i want to exit that sub. In Visual besic .Net there is command "EXIT SUB". In visual C# there is a static method call Application.exit but it is for close the whole application but i want only to exit the event and application should not be close. Please reply me as early as possible Thank you. (Hemant Uttam Mane) :)

        S Offline
        S Offline
        SJ_Phoenix
        wrote on last edited by
        #3

        normally you can exit a sub (in C# it's called method) with return....like this:

        public void Login()
        {
        //do some stuff here.....
        return;
        }

        1 Reply Last reply
        0
        • A A Wegierski

          Application.Exit() static method. See help Hi, AW

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          He said he didn't want to call that and exit the whole application.

          Microsoft MVP, Visual C# My Articles

          A 1 Reply Last reply
          0
          • H Heath Stewart

            He said he didn't want to call that and exit the whole application.

            Microsoft MVP, Visual C# My Articles

            A Offline
            A Offline
            A Wegierski
            wrote on last edited by
            #5

            Sorry Hi, AW

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups