Any bug in my Code?
-
Lets say i however fire the Close method.and close it is fine. but i want to confirmed it is actually close and dispose with that resources. Because i have a page and i have used a TVgrabber componenet and show TV card tuner, but when i going to another page closing that..it gets flicker with my page. I couldn't close that Grabber properly also i want to dispose all in. using System; using System.Data; using System.Data.SqlClient; using System.Collections; namespace ItvC { public partial class frmTVX : Form { public static frmTVX tv = null; public frmTVX() { InitializeComponent(); tv = this; } private void Close() { this.TopMost = false; this.Close(); frmMain.FormMain.Show(); } } }
-
Lets say i however fire the Close method.and close it is fine. but i want to confirmed it is actually close and dispose with that resources. Because i have a page and i have used a TVgrabber componenet and show TV card tuner, but when i going to another page closing that..it gets flicker with my page. I couldn't close that Grabber properly also i want to dispose all in. using System; using System.Data; using System.Data.SqlClient; using System.Collections; namespace ItvC { public partial class frmTVX : Form { public static frmTVX tv = null; public frmTVX() { InitializeComponent(); tv = this; } private void Close() { this.TopMost = false; this.Close(); frmMain.FormMain.Show(); } } }
Well... First, you're calling Close() from within itself. Eventually, you're gonna run out of stack space. Second, the last line in Close() will never be executed because you're recursing back to the same function before it gets there. I'm surprised your system hasn't caught fire yet as a result.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001