I have four textboxes and 10 buttons for digits. I need to change
background of textboxes when one of four is focused. But when i click
on button there i loose textbox focus and background return to normal
(from focused visual state). So how can i prohibit buttons to catch focus when i clicked
them and save focus on textboxes?
Are you using numbers on your buttons? If so, is there a specific reason that you're making your own number pad? If it is just because you want to have a number pad instead of the regular keyboard, are you aware that you can add this property to your textboxes InputScope="TelephoneNumber" which will give you a number pad similar to the telephone dialing pad.
Related
I'm trying to have a feature to allow users choose two different methods of cost calculation: either they can enter a yearly cost breakdown on a datasheet (2010: $10,000, 2011: $12,000, etc) or they can enter a flat yearly cost multiplied by the number of years they select.
If I were developing another kind of web application, I'd have radio buttons to select two different options. One option would display the datasheet, and the other option would display two text fields to enter values into. However, I understand that you can't have radio buttons in Access 2010 web databases. Also, is it possible to make elements appear and disappear based on a combo box selection?
If not, perhaps I could have two different combo box options: "enter yearly cost breakdown"
or "enter flat yearly cost," which open the correct respective forms as pop-ups.
So, 1) can I have Ajax-like appearing and disappearing elements as triggered by a combo box (or ideally, radio buttons), and 2) if not, can anyone think of another clever way of doing it?
Sure, you get a nice effect by using a tab control. You can place controls and even a sub form on that tab control.
So, you build a screen like this:
Then, simple set the visible property of the second tab = No. This will hide the tab (don't change this until you built the page since it will hide it! (use property sheet to hide/un-hide during development).
Now, add some code to the after update event of the list box. Like this:
In the above, I have named the tabs PYear and PFlat.
The result is this (this is a animated gif I inserted):
Of course, you really probably could just dump the whole "list box" selection, and use a screen like this with the tabs (tabs are good UI, and users tend to grasp them quick):
So, you can hide a "set" of controls, and it really far less work and hassle then writing a bunch of JaveScript anyway. As noted, the "set" of controls you drop into each of the tabs can be sub forms, and also that of continues forms. So, the "hiding" as a set does work well in this case. I did have some format issues and found that I had to "start out" with the 2nd tab dispaled first (the first one being hidden). As noted, the listbox selecting is nice, but one could likly just go with using tabs in the first place.
Im trying to create a password page similar to the one that opens up when you click Lock+wallpaper in the settings of the Windows Phone.
How ever I could not find a keyboard with the done and cancel, a done and cancel buttons along with the numeric keyboard is visible in the lock+wallpaper page when you toggle the password switch.
How do I get one similar to that? As as alternative I tried to create done and cancel buttons, but the problem is, the keyboard overlaps these buttons where as in the lock+wallpaper page, the keyboard stays and does not overlap the button.This should mean that the buttons are present along with the keyboard right?
Could anyone help me on this one?
There is no InputScope which add "done" or "cancel" buttons to the SIP.
Instead you should look to use the ApplicationBar and add buttons for each of these functions. FOr doen you could use an image of a tick or a save icon for "done" and a cross for "cancel".
Be careful not to add a Cancel button if you really don't need one as the hardware back button would suffice instead.
I'm writing a Silverlight+XNA game and when the user has something in their clipboard they can see less of the screen. I'd really like to be able to not show this clipbaord but I can't see any way (though it does seem to go away after some amount of time)
I've tried an empty string and Clipboard.SetText(null) but that throws an exception.
Unfortunately, there is no way to either clear the clipboard from code or influence the display of the SIP beyond setting an InputScope.
The best you can do for now is to update your design to allow for the amount of space which the SIP may use. :(
While more complicated, you could create your own text input keys as buttons, and instead of using a textbox, use buttons templated to look like textblocks, with background as you show above, and all... When the user taps the "button" that is a "textblock", you set a flag that says which textblock the keypad buttons send their numbers to.
Or, if the only spot you are sending inputs to (as it appears now that I look at your UI again), there is no need for the button template as the input space, or the flag. Just create buttons for user to tap for input, and send that input to the textblock that appears to be where your answer is. You could make the buttons whatever size you want, that way, as well, so you control how much of the screen is visible. Another thing you could do is make the buttons semi-transparent, so you could have even more background image showing.
Another thought - send the buttons all to the same event handler (except the backspace button), and have the code for that event handler look like this:
{
Button btn = sender as Button;
textblock.Text += btn.Content;
}
Does anyone know why Labels and Frames (and possibly other controls) have a TabIndex property in VB6? Is there some use for it; some feature of GUI programming I ought to be incorporating in my applications (that I am blissfully unaware of)?
To confirm what Cody said in the comments. The VB6 manual entry for TabIndex says:
Controls that can't receive the focus (Frame and Label controls) remain in the tab order but are skipped during tabbing.
but
If you press the access key for a Frame or Label control, the focus moves to the next control in the tab order that can receive the focus.
TabIndex is the property used to determine the sequence of focused controls when user presses TAB key.
If control with TabIndex=5 is focused and user presses TAB, control with TabIndex=6 will take focus.
I have a dynamically created tabpage for windows forms. the tabpage is split into two horizontal panels. The top panel should be able to hold up to 4 textboxes like this
TextBox1
TextBox2
TextBox3
TextBox4
There WILL be atleast one TextBox. Maximum is 4. How do I create a TabPage with two panels where the top panel only takes up the real estate as needed(i.e only use up the real estate for one textbox or 2 textboxes, or 3 textboxes or the maximum 4 textboxes) and the rest of the tabpage is available for Panel2.
Adjust the TabPage.height for the count of TextBox instances. Adjust the lower TabPage.height to fill in the remaining space.
Have you looked at FlowLayoutPanel? You can make any control (which a textbox is if i remember correctly) in the panel to break, that is, make the next control appear on a "new line". This property appears in the Property Window when selecting a control inside the panel, I just don't remember the name.