?
Solved

Readonly textbox still has "I" insert bar icon

Posted on 2004-10-13
7
Medium Priority
?
237 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
Independent Software Vendors: 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

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!

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

765 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