Is it possible force the build in keyboard to appear within a Windows CE 5.0 application?
I am designing a project in C# and would like the keyboard or a numerical keypad to pop-up when the user has to input to the application.
You should look at the InputPanel control. Just drop one onto your form from the toolbox. Then just show and hide it on the GotFocus and LostFocus events of the input controls:
private void textBox1_GotFocus(object sender, EventArgs e)
{
inputPanel1.Enabled = true;
}
private void textBox1_LostFocus(object sender, EventArgs e)
{
inputPanel1.Enabled = false;
}
Related
How can I make a .NET MAUI app to always be on top, top must, always visible?
I'm looking for an equivalent of Topmost="True" that we have in WPF.
I tried managing the UnFocused event and calling Focus(), but I had no luck:
private void Shell_Unfocused(object sender, FocusEventArgs e)
{
(sender as AppShell).Focus();
}
private void Shell_Disappearing(object sender, EventArgs e)
{
(sender as AppShell).Focus();
}
As suggested by Ralf, TopMost is a Windows Feature and that's a feature request can be tracked here:https://github.com/dotnet/maui/issues/8198.
If you want the feature works in Mac, you can follow up with Add "Topmost" shell/app feature
.
I just started working on C# with Visual Studio & Windows Forms Applications. I was trying to create a Calculator and I was wondering if I could change the cursor type on a button which is disabled, I can't figure out how to do it, please help me thank you!
Edit: here's the code I tried to do, it only works if the button's enabled...
private void txt_current_operation_MouseHover(object sender,EventArgs e) {
txt_current_operation.Cursor=Cursors.Hand;
}
Hack Answer
Assuming the Button is contained by the Form, you can handle the MouseMove event of the Form and change the cursor from there:
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
Rectangle rc = txt_current_operation.RectangleToScreen(txt_current_operation.ClientRectangle);
this.Cursor = rc.Contains(Cursor.Position) ? Cursors.Hand : Cursors.Default;
}
If the Button was contained by a Panel, or some other container besides the Form, then you'd change to the MouseMove event of that container instead.
Demonstration:
I want to show my google calendar in my application's tabs. How can I do it?
private void tabPage6_Click(object sender, EventArgs e)
{
//I want to add the code in this tab
}
You need to use a WeBrowser control for this. Drag and drop a WebBrowser control from Tools, suppose name of the WebBrowser control is webBrowser1 the use below code to open calendar
private void tabPage6_Click(object sender, EventArgs e)
{
webBrowser1.Navigate("https://www.google.com/calendar/");
webBrowser1.Show();`
}
I have a C# Windows Forms App that contain a menu bar.
I want to display a Help Message when I press on the "HELP" menu button.
All that I can see when I press view code is this:
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
}
I think that I need to create inside the function a MessageBox or an event that will display the desired message.
Do you have any idea how should I do this, please?
Below should work for what your asking. If you are on your form you can double click the button you want to interact with, and Visual Studio should take you to the empty method.
private void helpToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("This is supposed to be helpful");
}
I want create a form in C# that always be on top of taskbar and other programs.
I try with Topmost but when I click on Alt+Tab or start button on keyboard, taskbar is top of my form.
Ugly approach: use Timer.
private void timer1_Tick(object sender, EventArgs e)
{
this.TopMost = true;
}
Better not to do so.