Jump to content
Sign in to follow this  
hotfloppy

Camne Nak Wat Coding Select All Text

Recommended Posts

user posted image

camne nak wat form cam dalam gambar tu; bila kita klik pada button "select all text" tu, program akan automatik select semua text dalam text box tu ?

penin la pale aku memikirkan benda ni. unsure.gif

p/s ni soalan assigment, tapi rase cam tak penah blaja pun dry.gif

Edited by hotfloppy

Share this post


Link to post
Share on other sites

atas sebab diatas, aku bukak balik topic ni. aku mintak maap kalo telah melakukan "kesilapan besar" sampaikan benda ni perlu dihebohkan dalam topic lain. smile.gif

aku guna coding ni:

txtSelect.SelStart = 0
txtSelect.SelLength = Len(txtSelect.Text)

time kasih kepada user dalam #putera.com kerana kasi code ni. wink.gif

Edited by hotfloppy

Share this post


Link to post
Share on other sites

masa onclick... masukkan code nih

'aku terlupe plak nak taruk menatang nih
text1.setfocus
sendkeys "{home}+{end}"

TQ

Edited by aRmsTer

Share this post


Link to post
Share on other sites

masa onclick... masukkan code nih

 sendkeys "{home}+{end}"

TQ

wahhaa, lagi senang cara ni. time kasih ~ time kasih biggrin.gif

Share this post


Link to post
Share on other sites

huh.. itulah sebabnya...

kan dah banyak penyelesaian... biggrin.gif

anyway jangan amik hati lak hotfloppy.. itu sekadar teguran jer kay... aku pun bukan perfect sangat... kita kongsi ilmu untuk semua orang yer tak.... wink.gif

Share this post


Link to post
Share on other sites

erm.. tarak hal punya. biggrin.gif

Share this post


Link to post
Share on other sites

ok.. SelStart maknanya setkan starting point untuk text yang ada pada dalam kotak textbox.

Contoh:

Kalau setkan text1.SelStart = 2 maka starting pointer akan setkan pada huruf yang ke-2.

SelLength - Fungsinya untuk mengira jumlah huruf pada perkataan yang terdapat pada textbox.

Contoh:

text1.SelLength = "ayam" maka perkataan 'ayam' akan mengandungi 4 huruf.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...