|
|
Hello all,
In vb6 there are properties called scaleX & scaleY for the image or form.
What the equivilant for these properties in C#
Thanks for HELP
|
|
|
|
|
The graphics object offers a scale transform.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a windows application with two button and one textarea. the button are start and stop. When I press start I want the program to execute a method x amount of times until I press the stop button. I'm displaying and increment number in the text area and when I run the program it doesn't display anything and it just hands there and I can't click the stop button. How can i fix this and get it to work?
<br />
private void startBtn_Click(object sender, System.EventArgs e)<br />
{<br />
stopBtn.Enabled = true;<br />
startBtn.Enabled = false;<br />
StartService();<br />
<br />
}<br />
<br />
private void stopBtn_Click(object sender, System.EventArgs e)<br />
{<br />
startBtn.Enabled = true;<br />
stopBtn.Enabled = false;<br />
StopService();<br />
<br />
}<br />
<br />
public void StartService()<br />
{<br />
int counter =1;<br />
while (start)<br />
{<br />
status.Text += counter +" test \n"; <br />
<br />
counter++;<br />
Thread.Sleep(5000);<br />
}<br />
<br />
}<br />
public void StopService()<br />
{<br />
start = false;<br />
}<br />
<br />
|
|
|
|
|
You should not execute Thread.Sleep() on the UI thread, since that freezes the UI.
There are two solutions for your problem:
1)
use a separate thread, with a loop and a Thread.Sleep
a while loop seems appropriate, make it while(running)
where running is a bool set true and false by your buttons
2)
use a Windows.Forms.Timer, start and stop it with your buttons
and execute your periodic job in its tick event (without a Thread.Sleep of course).
Luc Pattyn
|
|
|
|
|
thanks Luc for the quick replay, can you give me an example of solution #2?
|
|
|
|
|
Something along these lines maybe (code is not complete!):
using System.Windows.Forms;
class demo {
Timer timer;
int count;
Label myLabel;
public demo() {
timer=new Timer();
timer.Interval=5000;
timer.Tick+=new EventHandler(demo_tick);
}
btnStart_Click(...) {
timer.Start();
}
btnStop_Click(...) {
timer.Stop();
}
void demo_tick(...) {
count++;
myLabel.Text="Tick #"+count;
}
}
This is the simplest solution of the two, but it required the repetitive task
to be short (since it runs on the UI thread). If there is too much work to do,
you should go for a separate thread.
Luc Pattyn
|
|
|
|
|
Thanks a lot Luc, I will give it a try in a few.
|
|
|
|
|
hi
i want to know how to save and retrieve data to/from XML file simple...
can anyone help me ?
thanks
|
|
|
|
|
Take a look at the System.Xml namespace especially XmlDocument , XmlReader and XmlWriter .
"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
|
|
|
|
|
using typed datasets..
they have WriteXml(...) and ReadXml(...) methods.
life is study!!!
|
|
|
|
|
Hi all,
I want to make custom voices for my TTS application. I have numerous voices from different companies yet I want to make my own.
Can anybody tell me of a good resource or a software to make my own custom voice and install it to the system with Microsoft Sam and all Lernaut and Hauspie etc.
Thank you
Bye
|
|
|
|
|
I have a task at my work and do not know how to do it.
Help!
Company has set of intranet forms (written long time ago) with hundreds of textboxes and radio buttons. My task to fill some textboxes programmatically from C# apps (which in turns pick up the text from DB).
For test I try to populate GOOGLE’s search textbox .
No success so far.
Help!
Frankww
frankwwttw@yahoo.com
|
|
|
|
|
Need Help !! is not a useful subject line.
What are the forms written in ? Basically, to do this in C#, you need to put a web browser control in your program, access the page's HTML and insert stuff into it, or you need to make changes to the original pages so they autopopulate themselves.
What have you tried ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
This is exactly how I start it!
I made a form with web browser control
Build a DOM tree.
I read links and saved it to DB.
Now I need to populate textbox (some of the textboxes do not have name to refer to)
GOOGLE search box is a good example.
Frank.
frankwwttw@yahoo.com
Frank
|
|
|
|
|
Frankww wrote: (some of the textboxes do not have name to refer to)
Then you need to change the original code, so they do.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Frankww wrote: My task to fill some textboxes programmatically from C# apps
Is this for the purpose of (a) displaying a pre-filled form to the user (b) submitting the form with some items pre-selected or (c) something else? If it's (b), you can use this[^] class to preset POST arguments and submit the form on your behalf.
/ravi
|
|
|
|
|
Is this for the purpose of (a) displaying a pre-filled form to the user (b) submitting the form with some items pre-selected or (c) something else? If it's (b), you can use this[^] class to preset POST arguments and submit the form on your behalf.
it is for
(a) displaying a pre-filled form to the user
User opens internet with MS Internet explorer gets about 25 textboxes and radio buttons
Then using old stile CICS (main frame) copy and paste text to textboxes and his/her notes.
I can read it directly from DB but how to put it into boxes?
Frank
frankwwttw@yahoo.com
|
|
|
|
|
Frankww wrote: old stile CICS
Yowza! This brings back memories of 14" wide fanfold!
But to answer your question, I expect you could get at the web browser control's Document (which is a HtmlDocument [^], find the appropriate Form , find the appropriate Control and manipulate it.
(Caveat: This is off the top of my head and hasn't been verified.)
/ravi
|
|
|
|
|
which is a HtmlDocument[^], find the appropriate Form, find the appropriate Control and manipulate it.
I am working on it for more then a week.
And all time with
“web browser control's Document”
Nothing is done!
Frank
frankwwttw@yahoo.com
|
|
|
|
|
Frankww wrote: I am working on it for more then a week. And all time with “web browser control's Document”. Nothing is done!
We could try to help if were able to describe a specific problem you're having.
/ravi
|
|
|
|
|
We could try to help if were able to describe a specific problem you're having.
How to say in c# app:
textboxName.text=MyText // if textboxName is in the browser (even if browser is in the form)
i have from browser
input name=hl type=hidden value=en>
|
|
|
|
|
Frankww wrote: How to say in c# app:
textboxName.text=MyText // if textboxName is in the browser (even if browser is in the form)
i have from browser
input name=hl type=hidden value=en>
Here's a code snippet (untested, and with no error checking) that will hopefully point you in the right direction.
HtmlDocument doc = webBrowserCtrl.Document;
HtmlElement ele = doc.GetElementById ("q");
ele.InnerText = "MyText";
/ravi
|
|
|
|
|
Hi.
I'd developed a C# windows application and now I want to convert it to VB.Net project.
Is there any application to do it?
yah, there is some online utilities that can convert a C# code to VB.Net, But I need a software that give a C# application, and returns a VB.Net application.
Best wishes
|
|
|
|
|
SharpDevelop can do this I think.
Tried Google[^]?
I have no idea what I just said. But my intentions were sincere.
Poore Design
|
|
|
|