|
i have a C# windows application form and i want that on clicking a button the value in a textBox should be incremented. for e.g. if i have entered 0 in the textBox ,every time i click the button the value in textBox should be incremented to 1,2,3,...and so on.But everytime the form runs the increment starts from 0. Is there any way to store the value contained in the textBox after the form closes and increment that value when i click the button when the form runs the next time?...Plz. Help
|
|
|
|
|
There are many, but depends what suits you the most. Basically, you need to save this value in some persistent store( eg flat file, database, registry etc).
At the form load, read this value from the sorce and display in that texbox.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
If you need this value only during the application running you can save it in the static Program class
else if you need to read this value after closing the application you can save it in an XML file or TXT file if this value does not have a secure meaning else save it in a database or in the user system registry.
Dad
|
|
|
|
|
This is the same question as you asked already as "incrementing using C#.Net"
Didn't you liek the answers you got there? You will only get the same again.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
have u tried using static variables ?
|
|
|
|
|
i'm not sure if this can be done using a static variable....can a static variable retain its last value when the page loads again?
|
|
|
|
|
Hello,
I am using the following code to delete an HTML element form a document displayed in a webbrowser control:
HtmlElement elem = webBrowser1.Document.GetElementFromPoint(e.ClientMousePosition);
elem.OuterHtml = "";
MessageBox.Show(webBrowser1.DocumentText);
but when I display the webbrowser documenttext property I found the original html including the deleted element!
How can I delete an html element in a web browser control?
Dad
|
|
|
|
|
Never having used the web browser control I am guessing so! I presume when you load in the document you are reading from the original, you then delete a control in the browser control. This ONLY affects the copy loaded into the control NOT the original source.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
OK, but how can I get the new html copy from the web browser.
Dad
|
|
|
|
|
You will have to remove the element from it's parent. I dont think setting OuterHtml will have any effect.
|
|
|
|
|
HI
i am working on c# windows application.When i click the button a validation window has to be open ,i am getting this in minimised state
how to get it in normal state.I am new to .net development
any sugesstions please
|
|
|
|
|
go to the properties of the window and set the Window State property to Normal.
|
|
|
|
|
Hello everyone,
In my local computer, if I know the sub-web site name is "MyTestSite" under the Web Sites category of IIS manager, how could I retrieve the absolute physical file path for the sub-web site?
thanks in advance,
George
|
|
|
|
|
type 'inetmgr' in the run.then you will be able to see all the application under the defaultwebsite in iis.rightclick on "MyTestSite" press properties.Then you will see a textbox labeled as LocalPath.That is Physical path.If your site resiides in ~\inetpub\wwwroot folder then it'll show \MyTestSite.
Cheers!!
Brij
|
|
|
|
|
Thanks Brij,
My question is about how to get it in a programmig way.
regards,
George
|
|
|
|
|
Do some research on Mapserverpath.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can not find any useful samples from both Google and MSDN. Could you post your preferred link or samples please?
regards,
George
|
|
|
|
|
He meant Server.MapPath()
|
|
|
|
|
Thanks leppie,
I have found it. My question is how to use Server object in a console C# program? I found all samples are in ASP.Net.
regards,
George
|
|
|
|
|
thank you
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How can i call the button click event of a button by Enter key of keyboard
|
|
|
|
|
|
Hi,
On the key press event write the following code:
this.InvokeOnClick(button1, e);
|
|
|
|
|
hello,
I am trying to insert data into a database.My code gives no error.
But the values are not inserted into database.
Please help...can anyone send a sample code
|
|
|
|
|
Could u show ur code?
Is there any error in database connection?
|
|
|
|