Click here to Skip to main content
15,867,453 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Items in listbox Pin
CrafterIt10-Nov-10 2:20
CrafterIt10-Nov-10 2:20 
GeneralRe: Items in listbox Pin
venugopalm10-Nov-10 3:58
venugopalm10-Nov-10 3:58 
QuestionMaintain TextBox selection despite window loosing focus? Pin
FocusedWolf23-Oct-10 11:49
FocusedWolf23-Oct-10 11:49 
AnswerRe: Maintain TextBox selection despite window loosing focus? Pin
Abhinav S23-Oct-10 17:28
Abhinav S23-Oct-10 17:28 
GeneralRe: Maintain TextBox selection despite window loosing focus? [modified] Pin
FocusedWolf23-Oct-10 19:45
FocusedWolf23-Oct-10 19:45 
GeneralRe: Maintain TextBox selection despite window loosing focus? Pin
Abhinav S23-Oct-10 22:32
Abhinav S23-Oct-10 22:32 
GeneralRe: Maintain TextBox selection despite window loosing focus? Pin
Pete O'Hanlon25-Oct-10 5:12
subeditorPete O'Hanlon25-Oct-10 5:12 
GeneralRe: Maintain TextBox selection despite window loosing focus? [modified] Pin
FocusedWolf26-Oct-10 11:26
FocusedWolf26-Oct-10 11:26 
Ok, i was able to replace half of the solution with wpf-acceptable code, i.e. for a separate stackpanel, which contained controls which i didn't want to steal focus from my textbox, i simply set that stackpanel to have this property: FocusManager.IsFocusScope="true", and what i understand this did was create a separate focus-tree/scope/thing so those controls would not be able to affect my textboxes focus. (source: http://wpfhacks.blogspot.com/2009/06/correct-way-keep-selection-in-textbox.html)

But so far i do not see an alternative to the following code, which prevents the textbox from being notified that the window lost focus:

<br />
        #region WndProc in order to prevent the textbox from loosing focus when the window losses focus<br />
<br />
        const int WM_KILLFOCUS = 8;<br />
<br />
        protected override void OnSourceInitialized(EventArgs e)<br />
        {<br />
            base.OnSourceInitialized(e);<br />
            HwndSource source = PresentationSource.FromVisual(this) as HwndSource;<br />
            source.AddHook(WndProc);<br />
        }<br />
<br />
        IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)<br />
        {<br />
            if (msg == WM_KILLFOCUS)<br />
                handled = true;<br />
            <br />
            return IntPtr.Zero;<br />
        }<br />
<br />
        #endregion<br />


modified on Tuesday, October 26, 2010 5:38 PM

QuestionWPF TreeView MultiBinding Pin
Valentine Vlasov23-Oct-10 6:47
Valentine Vlasov23-Oct-10 6:47 
QuestionHow can I load gridview using ria service in MVVM ? Pin
kimo code23-Oct-10 3:06
kimo code23-Oct-10 3:06 
QuestionOpion Poll: Pin
ProtoBytes22-Oct-10 11:05
ProtoBytes22-Oct-10 11:05 
QuestionHas any one seen a good video series on the complete proess of going from SketchFlow ProtoType -> Application? Pin
ProtoBytes22-Oct-10 11:02
ProtoBytes22-Oct-10 11:02 
QuestionI should know the answer to this question, how do you create writeablebitmap images in WPF / Silverlight 4 Pin
ProtoBytes22-Oct-10 10:57
ProtoBytes22-Oct-10 10:57 
QuestionI am using Blend Studio 4 - Designer, where is the GPU acceleration? Pin
ProtoBytes22-Oct-10 10:45
ProtoBytes22-Oct-10 10:45 
QuestionSilver Light / WPF .NET 4.0 Pin
ProtoBytes22-Oct-10 10:38
ProtoBytes22-Oct-10 10:38 
QuestionHow using dataform and WCF Pin
Coban_22-Oct-10 2:56
Coban_22-Oct-10 2:56 
AnswerRe: How using dataform and WCF Pin
Abhinav S23-Oct-10 17:57
Abhinav S23-Oct-10 17:57 
QuestionProblem consuming a WCF service + Silverlight 4 Pin
CrafterIt22-Oct-10 2:01
CrafterIt22-Oct-10 2:01 
AnswerRe: Problem consuming a WCF service + Silverlight 4 Pin
SledgeHammer0122-Oct-10 6:41
SledgeHammer0122-Oct-10 6:41 
GeneralRe: Problem consuming a WCF service + Silverlight 4 Pin
CrafterIt26-Oct-10 3:17
CrafterIt26-Oct-10 3:17 
QuestionAssign Datagrid Value From Child Web Page To A Textbox In Parent Webform by silverlight Pin
ya_yayeeh21-Oct-10 22:44
ya_yayeeh21-Oct-10 22:44 
QuestionRowDetailsTemplate - Can't Edit Data [modified] Pin
eddieangel21-Oct-10 14:27
eddieangel21-Oct-10 14:27 
QuestionGridView displaying 2 columns with custom controls Pin
Gareth H20-Oct-10 3:03
Gareth H20-Oct-10 3:03 
AnswerRe: GridView displaying 2 columns with custom controls Pin
Gareth H20-Oct-10 23:08
Gareth H20-Oct-10 23:08 
AnswerRe: GridView displaying 2 columns with custom controls Pin
Gareth H21-Oct-10 6:12
Gareth H21-Oct-10 6:12 

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.