Difference between revisions of "Setfocus Method"
From Lianjapedia
(Created page with '{{Common Method}} Category:Methods Category:Common Methods') |
|||
Line 1: | Line 1: | ||
− | + | __NOTOC__ | |
+ | Gives focus to the object. | ||
+ | |||
+ | <pre> | ||
+ | ob.setfocus | ||
+ | </pre> | ||
+ | |||
+ | ==Example== | ||
+ | <code lang="recital"> | ||
+ | // | ||
+ | // Lianja custom section for page "page1" section "section1" | ||
+ | // | ||
+ | namespace custom1 | ||
+ | public textbox1, textbox2, textbox3 | ||
+ | define class page1_section1 as section | ||
+ | enddefine | ||
+ | |||
+ | define class focus_button as CommandButton | ||
+ | proc click | ||
+ | textbox1.setfocus | ||
+ | endproc | ||
+ | enddefine | ||
+ | |||
+ | define class sourceclass as CommandButton | ||
+ | enddefine | ||
+ | |||
+ | proc page1_section1 | ||
+ | page1_section1 = createobject("page1_section1") | ||
+ | |||
+ | page1_section1.addobject("focusbutton","focus_button") | ||
+ | focusbutton.caption = "Focus on Textbox 1" | ||
+ | |||
+ | page1_section1.addobject("textbox1", "Textbox") | ||
+ | textbox1.text = "Textbox 1" | ||
+ | |||
+ | page1_section1.addobject("textbox2", "Textbox") | ||
+ | textbox2.text = "Textbox 2" | ||
+ | |||
+ | page1_section1.addobject("textbox3", "Textbox") | ||
+ | textbox3.text = "Textbox 3" | ||
+ | return page1_section1 | ||
+ | </code> | ||
[[Category:Methods]] | [[Category:Methods]] | ||
[[Category:Common Methods]] | [[Category:Common Methods]] |
Revision as of 07:11, 29 September 2011
Gives focus to the object.
ob.setfocus
Example
// // Lianja custom section for page "page1" section "section1" // namespace custom1 public textbox1, textbox2, textbox3 define class page1_section1 as section enddefine define class focus_button as CommandButton proc click textbox1.setfocus endproc enddefine define class sourceclass as CommandButton enddefine proc page1_section1 page1_section1 = createobject("page1_section1") page1_section1.addobject("focusbutton","focus_button") focusbutton.caption = "Focus on Textbox 1" page1_section1.addobject("textbox1", "Textbox") textbox1.text = "Textbox 1" page1_section1.addobject("textbox2", "Textbox") textbox2.text = "Textbox 2" page1_section1.addobject("textbox3", "Textbox") textbox3.text = "Textbox 3" return page1_section1