I think d@nish has the right idea. I assume (probably a big mistake ) you're creating the "close" button from the same level you're creating the tab control, like so:
// Then some time later...
Maybe not in the constructor necessarily, but you get the idea. Anyway, I set the closeButton's click handler to a function in Form1 in this case, that would somehow close your tab (as for the actual close operation, I'm not sure how to do that, I haven't done much with tab controls).
I am connecting to a printer and when it's offline, it takes about 20 seconds before the exception. The printer is called from a timer that fires every 20 seconds. Is there a way to make the faster, or to check the status and get an immediate response, like in 1 or 2 seconds?
Public Shared Function SendStringTCP(ByVal Hostname As String, ByVal Port As Integer, ByVal StringToSend As String)
Dim bSend() As Byte = Encoding.ASCII.GetBytes(StringToSend)
Dim MyTCP As New TcpClient 'create a TCP client
Dim MyStreamTCP As NetworkStream
MyStreamTCP = MyTCP.GetStream
If MyStreamTCP.CanWrite Then
MyStreamTCP.Write(bSend, 0, bSend.Length)
Catch ex As Exception
I have an .exe which is working fine. Now I have to make a schedular programatically which will invoke the .exe(console app) every day at 6.00PM and performs the operation and then quit after completing the job.
You can use a timer or a thread in your C# application testing current time. When current time is 6.00 you call Process.Start method
I think that the best way is to use windows task scheduler.
Can anybody point me to some information on creating a databound control like the DataGridViewComboBoxColumn? I've been trying to format the DataGridViewLinkColumn like the ComboBoxColumn where the cell is linked to a seperate table that is referenced by cell's ID value. The reason for doing this is because I want a friendly text displayed instead of the unpleasent id value showing. The problem is that the DGVLinkCell does not behave like an html link where you can store the url and the text seperately.
Any help would be greatly appreciated,
I've used up all my sick days, so today I'm calling in dead.
Inherit from the DataGridViewComboBoxColumn, add necessary information to private fields (for example reference to dataset holding values, selected key value and so on), use tag property to link user selected text to the actual object or row.
I have a windows form Which has a listView.I allowed users to select some columns from listview.Then,I get those selected items to listviewcollection object.I don't know how to get different columns from that collection.Please help me to do that.
How to insert multiple records into a database table that are entered into a datagridview. With a single shot of Save all the records in the datagridview should be updated using C# . Can any one help me in this regard.
Please tell me the solution as i have wasted near about whole day on this. I did not find help in google search.
Windows service is not needed here when it needs to work only at a specified time. You can write a console application which deletes file and quits automatically. Schedule this program using windows scheduler to run at specified time.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia