[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

disable textbox selection/focus

avi

2/25/2012 11:23:00 AM

Is there a way to prevent textbox from geting focus or being selected
while still beeing enabled and keeping the font color?

Thanks
Avi
13 Answers

Mike Williams

2/25/2012 1:39:00 PM

0

"avi" <aviben@bezeqint.net.il> wrote in message
news:733e192e-cf91-4442-ac79-c96e344a9366@i2g2000vbv.googlegroups.com...

> Is there a way to prevent textbox from geting focus or being
> selected while still beeing enabled and keeping the font color?

I presume you meant, "while still /giving the appearance of/ being enabled"?
If that is the case then leave the TextBox enabled but place it inside a
container, such as a Frame or a PictureBox, and set the container's Enabled
property to False. For example, if you have a TextBox and an otherwise
unused PictureBox on your Form you could do something like:

Picture1.BorderStyle = vbBSNone
Picture1.Width = Text1.Width
Picture1.Height = Text1.Height
Set Text1.Container = Picture1
Text1.Move 0, 0
Picture1.Enabled = False

Mike


Larry Serflaten

2/26/2012 4:16:00 PM

0

On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
> Is there a way to prevent textbox from geting focus or being selected
> while still beeing enabled and keeping the font color?
>
> Thanks
> Avi

Are you sure you wouldn't rather use a Label, that just looks like a
textbox (window background, fixed border) ???

LFS

benita ron

2/27/2012 5:27:00 PM

0

On 26 ??????, 18:15, Larry Serflaten <serfla....@gmail.com> wrote:
> On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
>
> > Is there a way to prevent textbox from geting focus or being selected
> > while still beeing enabled and keeping the font color?
>
> > Thanks
> > Avi
>
> Are you sure you wouldn't rather use a Label, that just looks like a
> textbox (window  background, fixed border) ???
>
> LFS

Good idea. I am goiing to see if it does the work

Many thanks

Avi

Mike Williams

2/27/2012 7:16:00 PM

0

"benita ron" <benita.ron@gmail.com> wrote in message
news:79d3a09c-b000-4f5f-9822-0ac193564bed@l14g2000vbe.googlegroups.com...
On 26 פ×?ר×?אר, 18:15, Larry Serflaten <serfla...@gmail.com> wrote:
> On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
>
> > Is there a way to prevent textbox from geting focus or being selected
> > while still beeing enabled and keeping the font color?
>
> > Thanks
> > Avi
>
> Are you sure you wouldn't rather use a Label, that just looks like a
> textbox (window background, fixed border) ???
>
> LFS

Good idea. I am goiing to see if it does the work

You'll find that it works fine. The only problem you'll come across is the
fact that a Label when set up to look like a standard TextBox does not
position or wrap its text in quite the same way as a TextBox (the left edge
of the text is closer to its left border for example).

Mike


Karl E. Peterson

2/28/2012 12:19:00 AM

0

Mike Williams used his keyboard to write :
> "benita ron" <benita.ron@gmail.com> wrote:
>> On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
>>
>> > Is there a way to prevent textbox from geting focus or being selected
>> > while still beeing enabled and keeping the font color?
>>
>> > Thanks
>> > Avi
>>
>> Are you sure you wouldn't rather use a Label, that just looks like a
>> textbox (window background, fixed border) ???
>>
>> LFS
>
> Good idea. I am goiing to see if it does the work
>
> You'll find that it works fine. The only problem you'll come across is the
> fact that a Label when set up to look like a standard TextBox does not
> position or wrap its text in quite the same way as a TextBox (the left edge
> of the text is closer to its left border for example).

Yeah, it's a good answer in a one-only or all-of-the-above situation,
but not so much in a mix-and-match design.

--
..NET: It's About Trust!
http://vfre...


Dee Earley

2/29/2012 5:30:00 PM

0

On 27/02/2012 19:15, Mike Williams wrote:
> "benita ron" <benita.ron@gmail.com> wrote in message
> news:79d3a09c-b000-4f5f-9822-0ac193564bed@l14g2000vbe.googlegroups.com...
> On 26 פ×?ר×?אר, 18:15, Larry Serflaten <serfla...@gmail.com> wrote:
>> On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
>>
>> > Is there a way to prevent textbox from geting focus or being selected
>> > while still beeing enabled and keeping the font color?
>>
>> Are you sure you wouldn't rather use a Label, that just looks like a
>> textbox (window background, fixed border) ???
>
> Good idea. I am goiing to see if it does the work

It will also lack the text box specific border that Aero draws.

--
Deanna Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

Karl E. Peterson

2/29/2012 5:50:00 PM

0

Deanna Earley expressed precisely :
> On 27/02/2012 19:15, Mike Williams wrote:
>> "benita ron" <benita.ron@gmail.com> wrote...
>>> On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
>>>
>>> > Is there a way to prevent textbox from geting focus or being selected
>>> > while still beeing enabled and keeping the font color?
>>>
>>> Are you sure you wouldn't rather use a Label, that just looks like a
>>> textbox (window background, fixed border) ???
>>
>> Good idea. I am goiing to see if it does the work
>
> It will also lack the text box specific border that Aero draws.

Huh? http://imgur...

--
..NET: It's About Trust!
http://vfre...


David Youngblood

3/1/2012 8:34:00 AM

0


"Karl E. Peterson" <karl@exmvps.org> wrote in message
news:jiloh4$g63$1@dont-email.me...
> Deanna Earley expressed precisely :
>> On 27/02/2012 19:15, Mike Williams wrote:
>>> "benita ron" <benita.ron@gmail.com> wrote...
>>>> On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
>>>>
>>>> > Is there a way to prevent textbox from geting focus or being selected
>>>> > while still beeing enabled and keeping the font color?
>>>>
>>>> Are you sure you wouldn't rather use a Label, that just looks like a
>>>> textbox (window background, fixed border) ???
>>>
>>> Good idea. I am goiing to see if it does the work
>>
>> It will also lack the text box specific border that Aero draws.
>
> Huh? http://imgur...
>

Themed textbox. The Label control does not take on the themed texbox
appearance when themes are enabled.

David


Dee Earley

3/1/2012 9:15:00 AM

0

On 01/03/2012 08:33, David Youngblood wrote:
> "Karl E. Peterson"<karl@exmvps.org> wrote in message
> news:jiloh4$g63$1@dont-email.me...
>> Deanna Earley expressed precisely :
>>> On 27/02/2012 19:15, Mike Williams wrote:
>>>> "benita ron"<benita.ron@gmail.com> wrote...
>>>>> On Feb 25, 5:22 am, avi<avi...@bezeqint.net.il> wrote:
>>>>>
>>>>>> Is there a way to prevent textbox from geting focus or being selected
>>>>>> while still beeing enabled and keeping the font color?
>>>>>
>>>>> Are you sure you wouldn't rather use a Label, that just looks like a
>>>>> textbox (window background, fixed border) ???
>>>>
>>>> Good idea. I am goiing to see if it does the work
>>>
>>> It will also lack the text box specific border that Aero draws.
>>
>> Huh? http://imgur...
>
> Themed textbox. The Label control does not take on the themed texbox
> appearance when themes are enabled.

Just like http://imgur...

--
Deanna Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

Karl E. Peterson

3/1/2012 5:43:00 PM

0

David Youngblood expressed precisely :
> "Karl E. Peterson" <karl@exmvps.org> wrote in message
> news:jiloh4$g63$1@dont-email.me...
>> Deanna Earley expressed precisely :
>>> On 27/02/2012 19:15, Mike Williams wrote:
>>>> "benita ron" <benita.ron@gmail.com> wrote...
>>>>> On Feb 25, 5:22 am, avi <avi...@bezeqint.net.il> wrote:
>>>>>
>>>>> > Is there a way to prevent textbox from geting focus or being selected
>>>>> > while still beeing enabled and keeping the font color?
>>>>>
>>>>> Are you sure you wouldn't rather use a Label, that just looks like a
>>>>> textbox (window background, fixed border) ???
>>>>
>>>> Good idea. I am goiing to see if it does the work
>>>
>>> It will also lack the text box specific border that Aero draws.
>>
>> Huh? http://imgur...
>
> Themed textbox. The Label control does not take on the themed texbox
> appearance when themes are enabled.

I can't imagine what you're referring to?

We're talking Windows 7, right? Isn't it clear from what I posted that
I have an Aero theme selected?

--
..NET: It's About Trust!
http://vfre...