Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default textbox insertion point.

In Userform1.TextBox1 I enter text normally. I can also insert pre-defined
strings by clicking on a combobox in the same Userform.
After the code runs to insert the predefined strings, the cursor does not
show in the textbox. I can obviously click in the box to make it appear;
however, it would be nice to have the insertion point visible when the code
to insert the string is finished running. I've tried SetFocus and SelStart,
but they don't do it.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default textbox insertion point.

I have had the same problem for a long time, and your post prompted me to
finally do something about it. It looks like the problem is that the userform
has lost the focus. I just got mine to work as intended by adding an
AppActivate command before the TextBox.SetFocus command. For example:

'Put the contents of the selected cell in the Pinyin form textbox.
frmPinyin.txtInput.Text = ActiveCell.FormulaR1C1
AppActivate "Pinyin Input", True
frmPinyin.txtInput.SetFocus

In this example "Pinyin Input" is the title of my userform, and txtInput is
the name of the textbox.

Hope this helps,

Hutch

"Bert" wrote:

In Userform1.TextBox1 I enter text normally. I can also insert pre-defined
strings by clicking on a combobox in the same Userform.
After the code runs to insert the predefined strings, the cursor does not
show in the textbox. I can obviously click in the box to make it appear;
however, it would be nice to have the insertion point visible when the code
to insert the string is finished running. I've tried SetFocus and SelStart,
but they don't do it.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Insertion Point Sandman Excel Discussion (Misc queries) 2 July 5th 08 04:44 PM
find textbox insertion point Bert[_7_] Excel Programming 4 May 7th 08 12:41 AM
how to change the insertion point color? smc11ca Excel Worksheet Functions 0 October 31st 06 05:11 PM
causing macros to run at insertion point Inobugs Excel Worksheet Functions 3 February 1st 06 06:19 AM
Positioning the Insertion Point in a TextBox DennisE Excel Programming 2 February 2nd 04 03:47 AM


All times are GMT +1. The time now is 07:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"