How do I connect a keyboard shortcut to a text box? - winforms

I have two labels:
"Source Directory:" & "Target Directory:"
and two text boxes:
"tbSource" & "tbTarget"
I have added a shortcut to each text box
"Alt + S" & "Alt + T"
This works fine, but if I try to add underscores to the labels
"&Source..." & "&Target..."
it breaks down. With the underscores only the first text box (tbSource) is ever selected. (With both shortcuts)
What am I doing wrong?

Jimi's answer is correct:
"Since your Labels use mnemonics, you just need to make sure that the TabIndex of your TextBoxes is set to the related Label's TabIndex + 1."

Related

Customize the iOS VKB toolbar

The native iOS VKB can have a toolbar, and this toolbar can have a blue "Done" text.
I would like to be able to translate the "Done" text into the local language of the app (the language bundle used by Codename One does not translate this text), also I would like to change the color of the "Done" text from blue to orange.
I don't know how to do these customizations with Codename One. Thank you for the directions.
The word "done" is used when localizing. Notice the lower case d. So adding "done" = "Localized String" to the resource bundle should work.

How to set the font for Text field hint when selected

I have used text field with hint "Phone Number". When I click on the text field the text "Phone Number" font will be increased automatically. I'm wondering is there any way I can control the size of the font when =text field control is in focus or selected. Please advise.
Code:
TextField num = new TextField("", "Phone Number", 10, TextField.PHONENUMBER);
Thanks
You need to style both the selected and unselected versions of the UIID in a consistent way. You can do that in the Codename One designer tool by editing the style you overrode and making sure both Selected and Unselected tabs have the same value for the font.

Telerik winforms Grid View Header Title

i need to put a title header in Telerik Gridview in winforms.
i tried
radGridView1.MasterGridViewTemplate.Columns["myColumn"].HeaderText = "first line \n Second line \n third line";
but it doesn't work. my referred link :
http://www.telerik.com/community/forums/winforms/gridview/2-lines-of-text-in-the-column-header.aspx
I tested the following and it is working:
In the designer set AutoSizeMode = ColumnHeader
Then add this line of code:
this.radGridView1.Columns[0].HeaderText = "This is a \n multiline \n header text";
Please note that the index [0] is relevant my test code. You shall set your column index considering that the first column is 0.
This is the result I got:
Let us know if this works for you.
When you set the text as you mentioned, the text will be multiline, but the header cell height is not enough, hence you are not able to see that other lines. You can change the header cells height by using this property:
radGridView1.TableElement.TableHeaderHeight = 100;
radGridView1.MasterGridViewTemplate.Columns[0].HeaderText = "first line \n Second line \n third line";
Alternative way to do that is to use the AutoSizeRows property (set to true), but this will auto size all rows in the grid according to their content, not just the header row.

How to create and show a infotip when clickng a label?

I'm using VSTUDIO2012, my problem seems simple but it's too hard for me,
EDIT: It's a "windows forms application"
I have a label and when i click at the label i want to show a little info in a "infotip" or "tooltip" or "ballontip", i want to show a message like for 5-10 seconds...
Someone can guide me about how to make this? or references on the web please?
EDIT2: I've tried this:
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
'MessageBox.Show("Use the 'Ctrl+C' hotkey to copy the" & vbNewLine & "mouse coordinates into the clipboard.", "Mouse XY by Elektro H#cker")
End Sub
Private Sub ToolTip1_Popup(sender As Object, e As PopupEventArgs) Handles ToolTip1.Popup
ToolTip1.Show("Tooltip text goes here", Label1)
End Sub
When you start your application, you should your form you're working on in the center of the screen.
On the left side of the screen you should see a panel labeled 'Toolbox' (it may be on different sides of the screen depending on how you arrange your panels. I think default is left though. If you don't see it you can show it by selecting 'Toolbox' from the view menu or by pressing "Ctrl + Alt + X".).
With the 'Toolbox' panel open, you should see several collapsible panels. Open either 'All Windows Forms' or 'Common Controls'. Near the bottom of each collapsible area is an element you can add labeled 'ToolTip'. Once its been added successfully, a light gray control panel appears with your new ToolTip control labeled 'ToolTip1'.
Once the control is added you simply right click on an element that you want to add a tooltip to such as a label. When the popup context menu appears choose 'Properties' (the very last option). This opens the Properties Panel.
When the Properties Panel opens, scroll to the bottom of the list. Right below the TextAlign Property should be a property called ToolTip on ToolTip1. Enter your tooltip text here. Now when a user hovers over your label, the text entered will appear in a standard yellowish popup tooltip.

Batch display of Tab spacing

Im making a batch game, and made a "email" screen which looked like this
echo - INBOX (1) -
echo - OUTBOX -
echo - SPAM (3) -
If I use TAB for spacing, the batch display is different than if I use spaces
(if I use Spaces, the batch file displays it looking like it does in notepad)
Why is this?
(Screenshot: http://db.tt/z4NGvhUz - Top is with Spaces, bottom is with tab)
The TAB is one character that, when it is displayed in the screen, it is expanded to the next 8-character tabulation position. A text that contains Tabs is shown differently depending on the text that appears before the first Tab. Spaces are always spaces and are always shown in the same way.

Resources