|
Rank: Member
Groups: Registered
Joined: 4/17/2012 Posts: 14
|
Bit of a long shot, but is there any obvious reason why the wavy red lines would only appear once a TextBox control has lost focus?
I'm having trouble with one part of a fairly large project I'm working on and I haven't been able to identify the exact cause of the problem, merely the symptoms, so I can't provide an example I'm afraid.
The window has a number of TextBox controls that are being spell checked. I'm using a single RapidSpellAsYouType object and just adding each control with AddTextComponent(TextBox).
Sorry to be vague, but if there's anything you could suggest that might be causing this behaviour, then it may at least give me a new line of investigation because at this moment I'm pretty stumped!
Thanks
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
If the error word is the last word in the textbox then you won't see it underlined until you change focus because that's when it knows you finished typing the word.... otherwise Well, it uses the TextChanged event to identify when new words have been added - is there any reason why that event might not be firing? One thing you could try, is getting it to highlight a word, and then type in front of the word - does it move the underline along with the word? Also, if you type a misspelling and it is not underline, can you right click and get the context menu - that would indicate that the problem is only adorner related. Best Jim -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 4/17/2012 Posts: 14
|
Thanks for the reply
I think I'm getting closer to the problem. I've noticed that the wavy red lines don't appear in a TextBox with it's BorderThickness property set to zero until the text is changed. This doesn't appear to be the exact issue I'm seeing though as setting this to something besides zero has no affect, but maybe it is in some way related?
Thanks again
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Seemed like a good lead but I can't reproduce - sorry Code: <Window x:Class="RSWPFCtrlTest.SimplePlainTB" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my="clr-namespace:Keyoti.RapidSpell.Wpf;assembly=Keyoti4.RapidSpell.WPF" Title="SimplePlainTB" Height="463" Width="877"> <Grid Name="g1"> <TextBox Height="297" HorizontalAlignment="Left" Name="textBox1" VerticalAlignment="Top" Width="855" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Text="This was." BorderThickness="0" /> <my:RapidSpellAsYouType Name="ayt" TextBox="{Binding ElementName=textBox1}"/> </Grid> </Window>
Does that not work for you? I think it goes without saying (but since this is a public forum I'll say it anyway), if you can reproduce your problem in something that I can run then we can fix it for you. I realize that is probably not doable so I am happy to prod around and see what we can figure out. FWIW I can't see how BorderThickness could affect it unless it's some underlying issue with adorners (if it is, then right clicking should still give you the spelling context menu). Jim -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 4/17/2012 Posts: 14
|
I've put the test project that demonstrates the BorderThickness issue I'm seeing here: www.catbusstop.com/WpfApplication2.zipIt might be to do with the way I'm adding the TextBox to the RapidSpellAsYouType or the version of the dll I have...
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Thanks, so IsReadOnly too, seems it makes the textbox slightly smaller. Anyway, should be fixed now http://keyoti.com/downlo...4-NOBORDER-READONLY.zip
-your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 4/17/2012 Posts: 14
|
Thanks for the update - that appeared to fix my issue with the BorderThickness, but didn't seem to make any difference to my original focus issue.
HOWEVER!
Upon additional fiddling, I switched on CheckDisabledTextBoxes and suddenly they started working. The reason for this is that all the controls on the window are disabled by default while the window loads in the background and then are enabled once everything has loaded. At a guess, it appears that the spell checker doesn't pick up the change in the IsEnabled flag on the TextBox until it has lost focus or the text has changed.
I'm pretty happy with the solution I've come up with, but thought it'd be useful to provide you some feedback now I've found the solution to my original issue :D
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Thanks for the heads up, we'll fix the bug in the next release. -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|