Click here to Skip to main content
15,911,035 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: how can I programmatically set control colors using hex values ? Pin
Christian Graus16-Sep-09 11:51
protectorChristian Graus16-Sep-09 11:51 
AnswerRe: [Message Deleted] Pin
abiemann16-Sep-09 14:00
abiemann16-Sep-09 14:00 
GeneralRe: [Message Deleted] Pin
Christian Graus16-Sep-09 14:48
protectorChristian Graus16-Sep-09 14:48 
AnswerSOLUTION ! Pin
abiemann16-Sep-09 14:55
abiemann16-Sep-09 14:55 
AnswerRe: how can I programmatically set control colors using hex values ? Pin
Insincere Dave16-Sep-09 16:40
Insincere Dave16-Sep-09 16:40 
Questionhow to uncheck the select all checkbox if anyother checkboxes in unchecked...in WPF?? Pin
Krishna Aditya16-Sep-09 4:34
Krishna Aditya16-Sep-09 4:34 
QuestionWPF Datagrid: How to change the DatagridColumnHeadersPresenter's Background property Pin
Jacobus0115-Sep-09 22:22
Jacobus0115-Sep-09 22:22 
QuestionWPF Applications not running in various machines [URGENT - HELP] Pin
Kunal Chowdhury «IN»15-Sep-09 18:46
professionalKunal Chowdhury «IN»15-Sep-09 18:46 
AnswerRe: WPF Applications not running in various machines [URGENT - HELP] Pin
Arun Jacob15-Sep-09 19:20
Arun Jacob15-Sep-09 19:20 
AnswerRe: WPF Applications not running in various machines [URGENT - HELP] Pin
Christian Graus15-Sep-09 20:12
protectorChristian Graus15-Sep-09 20:12 
QuestionRe: WPF Applications not running in various machines [URGENT - HELP] Pin
Kunal Chowdhury «IN»15-Sep-09 23:22
professionalKunal Chowdhury «IN»15-Sep-09 23:22 
GeneralRe: WPF Applications not running in various machines [URGENT - HELP] Pin
Kunal Chowdhury «IN»16-Sep-09 1:38
professionalKunal Chowdhury «IN»16-Sep-09 1:38 
GeneralRe: WPF Applications not running in various machines [URGENT - HELP] Pin
Christian Graus16-Sep-09 11:54
protectorChristian Graus16-Sep-09 11:54 
GeneralRe: WPF Applications not running in various machines [URGENT - HELP] Pin
Kunal Chowdhury «IN»16-Sep-09 18:42
professionalKunal Chowdhury «IN»16-Sep-09 18:42 
GeneralRe: WPF Applications not running in various machines [URGENT - HELP] Pin
Kunal Chowdhury «IN»16-Sep-09 19:16
professionalKunal Chowdhury «IN»16-Sep-09 19:16 
AnswerRe: WPF Applications not running in various machines [SOLVED] Pin
Kunal Chowdhury «IN»21-Sep-09 23:11
professionalKunal Chowdhury «IN»21-Sep-09 23:11 
QuestionHow to access UIElements attributes in a column of a datagrid [modified] Pin
rizwan.saddal15-Sep-09 5:24
rizwan.saddal15-Sep-09 5:24 
RantWPF ListBox focus stupidity Pin
Gary Wheeler15-Sep-09 4:23
Gary Wheeler15-Sep-09 4:23 
I've just discovered a bit of WPF ListBox stupidity. If you have a data-bound ListBox, and you set the SelectedItem programmatically, the item you picked is indeed the selected item when the control is displayed. If you use the keyboard to move the selection, however, you find out that the focus item is the first item in the control. On your keypress, the ListBox moves the selection to the first item in the control, rather than the item before/after the previously selected item. Dumb.

Fortunately, the fix is easy. In the Loaded() handler for the container of your ListBox, add the following:
private void _Loaded(object sender, RoutedEventArgs e)
{
    if (List.SelectedIndex >= 0)
    {
        ListBoxItem item = 
            (ListBoxItem)
            List.ItemContainerGenerator.ContainerFromIndex(List.SelectedIndex);
        item.Focus();
    }
    else
    {
        List.Focus();
    }
}
Note that the ListBox instance is named List in this example, and this code assumes that the ListBox has the focus when the window is loaded.

Software Zen: delete this;

QuestionHow to fix components in a Drag & Drop canvas Pin
Nekkantidivya14-Sep-09 22:09
Nekkantidivya14-Sep-09 22:09 
AnswerRe: How to fix components in a Drag & Drop canvas Pin
Arun Jacob15-Sep-09 2:01
Arun Jacob15-Sep-09 2:01 
GeneralRe: How to fix components in a Drag & Drop canvas Pin
Nekkantidivya22-Sep-09 20:53
Nekkantidivya22-Sep-09 20:53 
QuestionSilverlight SDK Pin
CrazyCoder2614-Sep-09 19:43
CrazyCoder2614-Sep-09 19:43 
AnswerRe: Silverlight SDK Pin
Arun Jacob14-Sep-09 20:28
Arun Jacob14-Sep-09 20:28 
GeneralRe: Silverlight SDK Pin
CrazyCoder2614-Sep-09 20:40
CrazyCoder2614-Sep-09 20:40 
AnswerRe: Silverlight SDK Pin
Arun Jacob14-Sep-09 20:48
Arun Jacob14-Sep-09 20:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.