Understanding the parameters of a functions provided through manual [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I am working on a Laser system. The system comes with it's own manual, including an SDK reference, but I need help on understanding the definition of a function included in the reference:
and
To use this function, I have this code:
private void BrightnessButton_Click(object sender, EventArgs e)
{
Double setBrightness;
laser.setDispBrightness(out setBrightness);
}
But it keeps giving me this error:
may not be passed with the 'out keyboard'" << I think you meant 'keyword'
They also provided me with the sample code below:
How can I make this work? Any help in understanding how to program just simply the brightness would be appreciated. I am having trouble understanding what to put in for the parameters. Thanks

Only use an out variable when calling the get versions of the function. When calling the set versions of the function, you should have already set a value for the variable:
private void BrightnessButton_Click(object sender, EventArgs e)
{
Double setBrightness = .5; // set to 50%
laser.setDispBrightness(setBrightness);
}

Related

How to write below mentioned swift code in .cs file for xamarin? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 12 months ago.
Improve this question
I am new to xamarin and swift and I am creating a demo and in that, I have to write down some iOS related code which is mentioned below in code but the code is swift and I want to add that code in my .cs file so that I can use it with my UI page and it is giving errors as mentioned in the below image. It would be great if you can guide me with this and provide me with what code should I need to write and where.
UIApplication.shared.open(redirectUrl, options: [:], completionHandler: { success in
if success {
// Handle success.
} else {
// Handle failure. Most likely app is not present on the user's device. You can redirect to App Store using these links:
}
})
This should work for you. My advise, please refer to the official documentation it's all there.
var param = new NSDictionary();
UIApplication.SharedApplication.OpenUrl(new NSUrl("https://google.com"), param, (completed) =>
{
if (completed)
{
}
else
{
}
});

CS1525 C# Invalid expression term 'string' [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have this error and I have no ideo about what should I do
The aim is when I click to button, it should read the word in textbox and save it into the string variable by its new factor.I have the error oin the topic
private void panel_button_kelimeekle_kaydet_Click(object sender, EventArgs e)
{
if(panel_checkbox_ing.Checked)
{
string (panel_textbox_kelimeekle_yab.Text) = Ingkelimeler[(Ingkelimeler.Length+1)];
}
}
If panel_textbox_kelimeekle_yab is already a textbox on your form, then you don't need to declare its type when you assign a value to it. C# thinks you're trying to declare a new string variable.
Change that line of code to
panel_textbox_kelimeekle_yab.Text = Ingkelimeler[(Ingkelimeler.Length+1)];
This probably won't solve all your problems, but at least it will get you on to the next error message. (You probably mean Length-1 in your array index, but there's really no way for us to know.)

C# How to pause program [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have simple question. How do I pause program? I want to change pictures very slowly.
My code:
private void button2_Click(object sender, EventArgs e){
Image picture1 = Program.Properties.Resources.picture1;
Image picture2 = Program.Properties.Resources.picture2;
Button1.Image = picture1
//Here I want pause
Button1.Image = picture2
}
If you want procedural code (like in your example), without timers and without locking the UI:
await Task.Delay(1000)
You can use Threads or Timers.
http://msdn.microsoft.com/en-us/library/swx5easy.aspx
http://programmingbaba.com/how-to-stop-system-threading-timer-in-c-do-net/
Or you can use Sleep method to puase your program.
http://www.dotnetperls.com/sleep

Call a class in Visual studio through a button [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i have this project in my visual studio and i have a form which is linked to a solution in a project.
So, i need to call it on a button click.
It's like:
private void button1_Click(object sender, EventArgs e)
{
poComp.Client.StartpoComp
}
The thing is i have not copied the code the right way, houw should it proceed?
What is the file's structure?
Sorry, i know this might sound dumb and it probably is but i'm right in the beginning.
Below will do what (I think) you want to do but I strongly advise that you google "using classes c#" to try and find some tutorials
Here is just one
private void button1_Click(object sender, EventArgs e)
{
StartpoComp spc = new poComp.Client.StartpoComp();
//myFormsLabel.Text = spc.SomePublicVariable;
//spc.SomePublicMethod(param1);
}

TextBox DateTime format [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Im wondering how to make my textbox format "DD.MM.YYYY" that after load form the textbox will be filled with "__ .__ .__" and those spaces and dots cannot be deleted. Is there any way to do that?
Thanks
Why don't you use a MaskedTextbox? Use the following as mask, you can set the mask either at design time or at form load.
private void Form1_Load(object sender, EventArgs e)
{
maskedTextBox1.Mask = "00.00.0000";
}
You would probably be looking at something like Ajax Masked Edit
Another way to do it would be to use a jquery plugin
You could use a MaskedTextbox that will do exactly what you describe. A DateTimePicker might be better though...

Categories