[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Readonly textbox still has "I" insert bar icon

Posted on 2004-10-13
7
Medium Priority
?
238 Views
Last Modified: 2010-04-23
Hello Folks:

I am putting together a game GUI which contains several textboxes abstracting dice.  As such, I want these textboxes to be read only - my program will be the only thing that writes to these text boxes.

I need these boxes to be enabled as I need to process mouse events that occure on these boxes.  Also, I do not want the text to be muted - which happens when enabled=false.  So I am running enabled = true, readonly = true.  I've tried locked = true and false - my problem is the same.

The problem is - when the program starts all the readonly textboxes are empty.  There is an "I" insert bar in the upper left most text box.  If I type - nothing is echoed in the box - so I am confident the box is read only.

How do I get rid of the "I" bar?

Thanks in advance!
0
Comment
Question by:jflanner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12297049
Well the I icon will show whenever it has focus so you can avoid setting focus on the textboxes.

One way is to code the GotFocus of each textBox to set focus to some other control.

0
 
LVL 34

Expert Comment

by:flavo
ID: 12297072
use a label?
0
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12297096
another Idea is (Check it out if it really works I have not checcked it)

Define a custom Cursor instead of the I i.e. IBeam cursor, this cursor will be a blank image of same backColor as that of the TextBox then instead of the default Ibeam cursor set this new cursor for each TextBox using

TextBox1.Cursor=new Cursor("The new Cursor Path")

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Accepted Solution

by:
checoo earned 1000 total points
ID: 12297128
the easiest way is to have an additional textbox on the form. Set the height and width of this textbox to zero and set the focus  to this textbox when the form loads. SO when the form loads the user will not be able to see the "I" as this textbox will be practically invisible.
0
 

Author Comment

by:jflanner
ID: 12309690
checoo

I like the idea of moving the focus to a different component.  Now my really stupid question is - how do I do that?  I coded a load event handler:

    Private Sub BoggleGUI_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.textboxBoggleDie01.Focus()
    End Sub

But this does not seem to be working.  Any ideas???
0
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12316146
You need to use SetFocus method on getFocus of the textBox

see your user might click on the TextBox as well, in that case the focus will again shift to the TextBox so as I said earlier On the GotFocus event of the TextBox pass the focus to the dummy textBox

 Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
        TextBox2.Focus()
End Sub

0
 
LVL 9

Expert Comment

by:checoo
ID: 12316197
suppose you have a text box with name txtDummy then in the form load event you can use the following statement

txtDummy.focus()
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question