7 Replies - 457 Views - Last Post: 11 April 2012 - 05:54 PM Rate Topic: -----

#1 tendaimare  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 170
  • Joined: 04-November 10

how to close my form well

Posted 20 March 2012 - 02:44 AM

I am coding a form that is receiving 4 video feeds from 4 ip cameras and is also receiving scale readings from two scales using seriel port comms . however when I try to close the form using me.close it freezes for a while and then closes later I wanted to know how i can go about closing it neatly. and also when I open the form again it tales a long time to open.any ideas?
Is This A Good Question/Topic? 1
  • +

Replies To: how to close my form well

#2 claretrobbo  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 29
  • Joined: 19-March 12

Re: how to close my form well

Posted 20 March 2012 - 02:55 AM

this might help,

Try

me.hide
me.close

its worth a shot :)
Was This Post Helpful? 0
  • +
  • -

#3 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: how to close my form well

Posted 20 March 2012 - 03:16 AM

try End statement.
Was This Post Helpful? 0
  • +
  • -

#4 tendaimare  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 170
  • Joined: 04-November 10

Re: how to close my form well

Posted 20 March 2012 - 03:19 AM

thanks for the reply your idea works well. now I initialised this form while my splash form was loading but now if some one where to close the form and try to open it again it would take ages for it to open and disply the cctv footage that I want it to display and the scale readings. so closing the form works but it comes with a heavy price tag in that the form has to reload all my disposed resources all over again. any nints?
Was This Post Helpful? 0
  • +
  • -

#5 claretrobbo  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 29
  • Joined: 19-March 12

Re: how to close my form well

Posted 20 March 2012 - 03:36 AM

im just a beginner but I'd just use

me.hide

this will hide the form from the user but keep it open in the background.

If you have the standard maximise - minimise - close buttons but want to make the 'X' (close button) hide the form go to

form1.vb

click the top right dropdown box and chose 'Formclose'

in her type

me.hide


This will prevent the form from closing. If i helped plaese plus one me :)

**Edit - Sorry navigate both the dropdown boxes to..


Left - (Form1 Events)
Right (Formclosed)
Was This Post Helpful? 0
  • +
  • -

#6 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: how to close my form well

Posted 20 March 2012 - 03:38 AM

Actually I don't think you can speed up the execution of a program through a line of code. But you can always refactor your code. Go through it all over again and check for code where you think you can do better (Turn reusable code blocks into Functions etc) It'll optimize your program's performance.
Was This Post Helpful? 0
  • +
  • -

#7 Braber01  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 243
  • Joined: 29-November 08

Re: how to close my form well

Posted 11 April 2012 - 03:53 PM

Try
Me.Close()
Application.Exit()


Was This Post Helpful? 0
  • +
  • -

#8 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1533
  • View blog
  • Posts: 4,919
  • Joined: 25-September 09

Re: how to close my form well

Posted 11 April 2012 - 05:54 PM

I'm going to assume that you're probably using some type of threading for the video feeds or that when you are trying to close the form that the video feeds are taking longer to close. If you can abruptly stop the video feeds by cancelling any threads and then close the form it may be more responsive.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1