Re: Problems with Functions in C#

Hello, no problem glad i could help.
To answer few of your questions.

The  internal static .... line
Is basically a variable, for example if i would add a text box using code.

internal static TextBox MyBox {get; set;}

Would be the same as adding it on the form but it would require a few more bits to make it show up on there.
So using the definition we can call the tts to make something happen like speak.

Its a bit confusing to explain but in short its a variable.
And in this case its a variable pointing to the system.speech reference.

For your next question.
Why do i call it twice?

The first one is inside the constructor.
Where initialize is located.
A constructor is basically the first thing that loads when you run the program.
So Initializecomponents would load all the text boxes buttons etc on your form.

So what i have added when the form is loading / initializing.
Is basically to get all the installed voices and add them to the combo box on the form.

The one in the bottom where i create another instance of it.
Is to make sure that the speech synth is not null.
When null it wont be able to do anything.
So in case it would be null we create a new instance for it.
This way it will be able to run the functions that you want.
In this case set the voice and speak.

If you need more advice or help.
Or you want to learn some more be sure to contact me.
I will try my best to give you a hand.

Regards,
XSense

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Xsense via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Xsense via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Xsense via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Xsense via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Xsense via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector

Reply via email to