5 Replies - 389 Views - Last Post: 05 February 2013 - 03:18 PM Rate Topic: -----

#1 bmruze  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 14-December 12

Show window only once

Posted 03 February 2013 - 11:21 AM

Hey guys,

I have completed working on a program and have run into an issue. The program functions correctly with one exception. I am trying to make a window show only once when the program is first launched and then not show again if the program is launched again.

I tried to make this work by creating a file on the computer and if the file exists on the computer then it wouldn't show the form again however that doesn't seem like a very sound way of doing this task. Is there something I am missing on how I might go about using code to make something like this occur?

SplashScreens and Startup windows run every time the program is run which of course won't work. I searched google for things like "Show window only once on startup" but that revealed information on how to make your program work in the startup function of windows.

Any advise would be greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Show window only once

#2 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 193
  • Joined: 10-March 12

Re: Show window only once

Posted 03 February 2013 - 11:24 AM

instead of creating a file, you could use a registry key... set a boolean key value, example: IsFirstShown = FALSE
Make you program read the registry value at startup..if it is FALSE, hide the window...
Was This Post Helpful? 0
  • +
  • -

#3 bmruze  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 14-December 12

Re: Show window only once

Posted 03 February 2013 - 11:26 AM

Thank you, I will try that.
Was This Post Helpful? 0
  • +
  • -

#4 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 193
  • Joined: 10-March 12

Re: Show window only once

Posted 03 February 2013 - 11:30 AM

here are some starting points about registry keys: tutorial 1, tutorial 2
Was This Post Helpful? 0
  • +
  • -

#5 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 765
  • Joined: 19-October 11

Re: Show window only once

Posted 03 February 2013 - 11:30 AM

Take a look at My.Settings.
Was This Post Helpful? 1
  • +
  • -

#6 Bladewing51  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 68
  • Joined: 26-August 11

Re: Show window only once

Posted 05 February 2013 - 03:18 PM

I agree with Lucky3 My.Settings file pretty much replaced registry keys, much easier to manage and if something in it corrupts or doesn't work right you can just send the user or customer a new app.config file with defaults instead of having to walk someone who has no idea about computers thru the process of deleting or changing registry entires. (They could always delete the wrong thing and make the system non bootable)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1