|
Handle the Closing event on the form and cancel the operation (see the event arguments, e ). You can then hide the form instead.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Perfect Thanks!!
protected override void OnClosing(CancelEventArgs e)<br />
{<br />
e.Cancel = true; <br />
Hide();<br />
}
_____________________________
...and justice for all
APe
|
|
|
|
|
Hello community.
I have a problem and cannot solve it:
How can I measure the query execution time from my C# application?
I need to get a number or a time class to my app. from my database server, but
not measure the time when I got the informations from db but the internal time in db server. So I will display something like "Execution time: 0.0015 ms" in Sybase Interacive SQL.
I'm using Adatptive Server Anywhere v8 and v9
thanx lot
|
|
|
|
|
Try using the preformance counter: [^]
|
|
|
|
|
How does one highlight or de-highlight an item in a listview programmatically
|
|
|
|
|
you can use
listView1.Items[rownumber].Selected=true;
listView1.Select();
rahul
|
|
|
|
|
int index = //your index
listView1.SelectedIndex = index;
|
|
|
|
|
Hi Folks,
I am opening a Folder Browser Dialog. It opens with a help button which I dont want. Any idea how to remove Help Button from this dialog.
Thanks in advance.
|
|
|
|
|
Read this article.
Author changes OK button text by sending message. You can remove help button by the same way.
Best regards, Alexey.
|
|
|
|
|
|
Hi
Can any one tell me how to check for the end of row condition in the data base table using c#.
Is there any function like Movenext() to fetch next row values from the table?
|
|
|
|
|
Ashraj1982 wrote: Can any one tell me how to check for the end of row condition in the data base table using c#.
Is there any function like Movenext() to fetch next row values from the table?
It all depends on how you are getting the data out of the database in the first place.
It sounds like you are using a DataReader. The DataReader.Read() pulls in the next row from the database. It returns true if a row was fetched or false if there are no more rows.
Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Use :
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.textbox.Text = resources.GetString("Key1");
In your resource file, you must add -> Key1 = HelloWorld (for example).
|
|
|
|
|
I added first line of code to form1.designer.cs and have the text control retrieve the string.
but when debugging, the string doesn't show on the form designer.
What am i missing?
|
|
|
|
|
If you can retrieve the string, that means your problem is not in ResourceManager.
That must be at another place in codes.
|
|
|
|
|
I want to create charts dynamically using excel template. How can I set default characteristic to all the charts creating in this way? Please help urgent.
|
|
|
|
|
Try start recording macro in excel, and do manualy all actions you want.
Then look at the code of macro - and convert this code to C#.
Best regards, Alexey.
|
|
|
|
|
1) Is there a method for counting number of .xls files in a directory?
2) What is the best way to check if excel is installed on system?
|
|
|
|
|
1 - Directory.GetFiles ( from memory )
2 - probably checking some registry key.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
1)
int num = Directory.GetFiles("directorypath", "*.xls").Length;
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
|
Hi all,
can any one help me out in "How to restrict to paste text into a text box"
Please help me
Ravi Kumar Neelam
|
|
|
|
|
|
hi all,
i have two forms (named form1 and form2).
i call form2 from form1. when doing this, i hide form1.
but i want to show form1 again if form2 is closed.
how can i show form1 by form1.show ?
do i have to implement the following ???
form1 xyz=new form1();
xyz.show();
i dont want to create a new form1 instance just want to call the one i hide before ...
someone told me "Make sure that form2 has a way to reference form1 though."
how do i do this ? help me please ...
thanks in advance.
bye,
|
|
|
|
|
Simply register to the FormClosed event of form2 and inside the event handler make your form1 visible again:
form2 x = new form2();
x.FormClosed += new FormClosedEventHandler(this.Form_FormClosed);
this.Visible = false;
x.Show();
...
void Form_FormClosed(object sender, FormClosedEventArgs e)
{
this.Visible = true;
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|