Calculator windows forms c# [duplicate] - c#

This question already has an answer here:
Capture keyboard inputs without a textbox
(1 answer)
Closed 7 years ago.
I'm working on an university project of a windows forms calculator with c#.
Is fully functional, but the question is.
Can I insert numbers in the main textBox without focusing on it. I want it to work like windows calculator and insert numbers without having to click the textbox.
I've try a lot of methods like using the event Key_Press directly on the form but nothing works.
Ps. Is like windows calculator.

Set the Form.KeyPreview property to true and handle the Form_KeyPress event.

Related

wpf how to view desktop or go desktop by using user32 [duplicate]

This question already has answers here:
Programmatically show the desktop
(2 answers)
Simulating Key Press C#
(8 answers)
Closed 11 months ago.
hi i want to create application when i click the button it go to desktop, i mean when you press Win + D it go to desktop directly, i want to use user32 to be more practical, I want to use this method in the future too, but how?
i dont want to use this way, this road is a little weak :
II.Keyboard.KeyDown(VirtualKeyCode.LWIN);
II.Keyboard.KeyPress(VirtualKeyCode.VK_D);
II.Keyboard.KeyUp(VirtualKeyCode.LWIN);
thank you for answer

What is the equivalent of the Delphi "Hint" in C# Windows Desktop Forms applications? [duplicate]

This question already has answers here:
How can I add a hint or tooltip to a label in C# Winforms?
(6 answers)
How do I add a ToolTip to a control?
(6 answers)
Closed 1 year ago.
I'm starting to work in C#, I've created a Windows desktop application, based on a System.Windows.Forms.Form, as follows: (automatically generated)
public partial class Frm_MyForm : Form
As I have some experience in Delphi (almost twenty years ago), I was expecting everything back in this form, but I don't find a Hint attribute, not on the form itself, nor on the text boxes, labels or buttons I added there.
Does anybody know if hints are foreseen in C# projects of my kind?
My Target .Net framework version is "4.6.1".
Thanks in advance

How to simulate android back button press programmatically in Unity with C# [duplicate]

This question already has an answer here:
How to access mobiles back button in unity for android applications
(1 answer)
Closed 4 years ago.
I have done the same thing in android natively by simply calling onBackPressed().
I've been trying to do the same thing in Unity with c#. there are classes like Input that handles inputs but does not have access to android's back button.
I've also seen touch simulators and whatnots but I'm looking for something as simple as calling this.onBackPressed().
Please note that I'm not looking to capture back button press, I want to press back button from my code.
I've been using this.
if(Input.GetKeyDown(KeyCode.Escape))

Buttons in WinForms [duplicate]

This question already has answers here:
ToggleButton in C# WinForms
(12 answers)
Closed 7 years ago.
I'm currently working on some software in Windows Forms and I was wondering if there's any way to have the buttons stay in their "clicked" state? I want to use them like radio buttons so one would be "clicked" and the other normal, and will switch when the other is selected.
I've looked in the Button properties but I couldn't find anything
You can make checkbox or radiobutton look like a Button
cb.Appearance = Appearance.Button;

WPF Search button function [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Windows Phone 7 Search Button
I think that all Windows Phone mobiles have a search button (phisical or not).
Actually, they have three buttons: Back button, Windows Logo button, Search button.
Is possible to modify the function of this button (as Back button). Something like OnSearchKeyPress (as event handler).
Its possible?
This is not possible, because that could seriously alter the behavior of the phone. There is a search task you can use, for more info, see this MSDN article on it.

Categories