Set focus in Popup's Listbox in Silverlight - silverlight-4.0

I am working in Silverlight. In my Silverlight Application there is One Textbox and One Popup with Listbox.
When i Write any text in Textbox then my popup is open But i want to extend one more thing when i press Down Arrow Key that time i want to set focus in listbox item.
I have also try many thing and still i not getting any solution.
I also try this
int selectedIndex = lstRoot.SelectedIndex;
lstRoot.SelectedIndex = 0;
lstRoot.Focus();
lstRoot.SelectedIndex = selectedIndex;
Still focus is not set in lstRoot.
Please help me....!!

Try this.
lstRoot.SelectedItem = modelItem;
lstRoot.Focus();

Use ScrollViewer for scrolling Item and In Popup add Listbox for display items and you can easily set focus on listbox's item.
for eg.
lstRoot.Focus();
It through set focus on current scrolled item and easily up and down in listbox item.

Related

How to see if ComboBox is in DropDown State?

I have searched several forums but did not find answer for checking whether ComboBox is already DroppedDown via VBA code.
I have other code on Form_KeyDown events due to which anytime I press vbKeyDown it moves to next record. I need to check if ComboBox is DroppedDown then don't use other code and instead treat the default functionality of access where vbKeyDown will start scrolling through the items of ComboBox displayed in DropDown.
There is no such property, neither an event for OnDropDown or similar.
If the combobox has focus, you can force a dropdown using the DropDown method, but that's as close you can get.

UWP Listview not selectable but clickable items

I'd like to know if there's a way to make the ListView control items clickable when SelectionMode="None". When I set it to "None" there is no visual feedback when the user clicks on the items in the List (Like there is when user select an item when SelectionMode="Single").
Thanks
You can set IsItemClickEnabled to True on your ListView and handle ItemClick event instead.

Userform selected control

If you look at the pictures I want the white TextBox to be selected instead of the "Doorgaan" CommandButton. This is an userform. Does anyone know how I can change this?
How i want it :
How it is:
Depending how you want it to interact with the user, you can set different things.
If you don't want user to be able to Tab there then make the button property TabStop to False, otherwise change the order of the Tab by the property TabIndex.
Note you can manually "Activate" a control by the .SetFocus method in your code to make it the current activated control. e.g. TextBox1.SetFocus
You probably have the properties TabIndex = 0 for the Button and 1 for the TextBox. By default the control with the least TabIndex will have the focus. Just set TabIndex = 0 for the TextBox.

How to make clickable links from objectdatareader vb.net

This code works fine, the listbox shows the posts. But how do I get the posts on the front side show up as clickable links. Maybe not in the Listbox, perhaps in a panel or similar object?
If objDR.HasRows = True Then
Do While objDR.Read()
ListBox.Items.Add(Convert.ToString(objDR.GetString(1)
Loop
End If
If you want to show it as true links then you can't use the ListBox control. You could use a DataGridView and add a DataGridViewLinkColumn to it.
If you really want to use a ListBox control you could execute the link on the Click event.

How can I set the tab order in VB.NET?

I have a bunch of buttons on a form and when the person presses TAB I want the focus of the controls move in a specific order. Does anyone know how to do this?
If you have form with lots of control then manage tab index by below method:
Open form in design mode.
Click on “View” from toolbar --> “Tab Order” at bottom.
Example:
Then just click on controls one by one in order that you want to set tab order.
You can do this in the Designer as well, see Setting the TabIndex property of many form controls in Visual Studio?
Each item in your form-designer should have a TabIndex property.
Set the TabIndex in ascending order. (low-to-high)
Change the TabIndex property of your controls and enumerate them according to your need.