On 11/01/2008, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote: > > > 4) Also what happens if you set the selection for Edit1 via code > > > (.SelectAll method), but Edit1 doesn't currently have focus? Does the > > > focus jump to Edit1 automatically? > > > > no > > Umm... So if Edit1 doesn't have focus, no selection is show. > Somewhere else in code you call Edit1.SelectAll, but because Edit1 > doesn't have focus, nothing (visual) changes in Edit1 - it still only > shows a edit box with text (no selection rectangle). > > Then when the user tabs to Edit1, everything is selected. What if > programatically on partial text was selected. As soon as Edit1 > receives focus the previous selection is ignore and everything gets > selected (normal default behaviour). So why is the point of being > able to programatically do a selection it it's never seen (visually)?
Ah, I think I got it. I created a quick test in Delphi 7. If a TEdit's AutoSelect property is set to False, then the programatically created selections take effect when the edit component receives focus again. eg: Programatically select the first two characters in Edit1. Because Edit1 doesn't have focus you see no selection rectangle. As soon as Edit1 receives focus via the keyboard, the first two characters are selected. Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
