(Msg. 9) Posted: Mon Jun 30, 2008 6:55 pm
Post subject: Re: Detecting or reading the name of a textbox [Login to view extended thread Info.] Archived from groups: microsoft>public>word>vba>userforms (more info?)
Further, I have to agree with the question regarding textboxes in frames.
AND, if you are creating the textboxes (in the frame) dynamically - at run-
time - then you are indeed stuck. For you are correct, the MouseDown is not
there. You could possibkly write it in anyway, and make sure the name is the
nameof the in-the-future textbox.
I also have to say that unless there is areal serious reason for it, I rarely
create controls at run-time. It is much much easier to make controls
visible/invisble as required. I do often dynamically resize things, but
things that are already there.
Being already there, but say, resized tiny and invisible, all events for that
control are accessible.
fumei wrote:
>That is, only one mouse click is required. You click into the textbox, the
>name is written to the label. One click.
>
>>How can I detect the name of any textbox whith a mouse click in that textbox,
>>e.g. with the MouseDown Event?
>[quoted text clipped - 19 lines]
>>>Tanks in advance,
>>>Hans
(Msg. 10) Posted: Mon Jun 30, 2008 9:01 pm
Post subject: Re: Detecting or reading the name of a textbox [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Hi Fumei,
>By using the MouseDown for that textbox. I am not sure why the others are
>using the userform MouseDown.
because the code in userform mousedown
would be required only once, just for the form,
otherwise you would need the code for a textbox mousedown
for each textbox.
(Msg. 11) Posted: Tue Jul 01, 2008 1:25 am
Post subject: Re: Detecting or reading the name of a textbox [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Mon, 30 Jun 2008 18:55:32 GMT, "fumei via OfficeKB.com"
<u37563@uwe> wrote:
I solved the problem with reading the name and the contents of the
Dynamically created textboxes
fr_Velden is the frame
The names of the textboxes are: 'TextBox' and a number
col_CatalUnicode is a Collection
It works fine. That is what I need: the text in the TextBoxes
For Each ctl_Control In .fr_Velden.Controls
str_ControlName = ctl_Control.Name
str_ControlIdent = Left(str_ControlName, 7)
If str_ControlIdent = "TextBox" Then col_CatalUnicode.Add
Item:=ctl_Control.Text
Next
Thanks for your attention
Hans
>Further, I have to agree with the question regarding textboxes in frames.
>
>AND, if you are creating the textboxes (in the frame) dynamically - at run-
>time - then you are indeed stuck. For you are correct, the MouseDown is not
>there. You could possibkly write it in anyway, and make sure the name is the
>nameof the in-the-future textbox.
>
>I also have to say that unless there is areal serious reason for it, I rarely
>create controls at run-time. It is much much easier to make controls
>visible/invisble as required. I do often dynamically resize things, but
>things that are already there.
>
>Being already there, but say, resized tiny and invisible, all events for that
>control are accessible.
>
>fumei wrote:
>>That is, only one mouse click is required. You click into the textbox, the
>>name is written to the label. One click.
>>
>>>How can I detect the name of any textbox whith a mouse click in that textbox,
>>>e.g. with the MouseDown Event?
>>[quoted text clipped - 19 lines]
>>>>Tanks in advance,
>>>>Hans
All times are: Eastern Time (US & Canada) (change) Goto page Previous1, 2
Page 2 of 2
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum