Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox Cursor 2

Status
Not open for further replies.

scking

Programmer
Jan 8, 2001
1,263
US
We have controls that can not be updated by the user and would like to change the cursor from an IBeam to another type so they are unable to enter data. It seems that there is no standard property for a textbox to allow the user to define the cursor in design mode. I'm looking for a procedure that would allow me to change the cursor; possibly a Windows call. Could someone help me out please?


---------------------
scking@arinc.com
---------------------
 
We have controls that can not be updated by the user and would like to change the cursor from an IBeam to another type so they are unable to enter data

I'm confused as to how you think changing the cursor shape will affect the user's ability to enter data into a field. This is controlled by setting the Locked property for the control to YES.

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Agree with [blue]missinglinq![/blue] . . .

You can also set [blue]Allow Edits[/blue] to [blue]No[/blue] . . .

Calvin.gif
See Ya! . . . . . .
 
Actually, if you set the locked property you can't select from a combobox. But, if you use the screwdriver cursor you can't enter anything in the box or edit it. They need to be able to select a combobox item but not change it. Neither locked nor enabled properties fill the bill.

---------------------
scking@arinc.com
---------------------
 
Maybe I dont understand the question, but can you not set the limit to list property?

Pampers [afro]
Keeping it simple can be complicated
 
We have controls that can not be updated by the user and would like to change the cursor from an IBeam to another type so they are unable to enter data. It seems that there is no standard property for a textbox to allow the user to define the cursor in design mode.

Your original post said you were concerned with preventing input into a text box. Nothing was said about a combobox! If it's a combobox you're concerned about, Pampers suggestion would be one approach. Another approach, since you don't want the user to be able to enter anything in the combobox, would be to ditch the combobox and use a listbox instead. It doesn't allow the user to type in anything.

BTW, what "screwdriver cursor" are you referring to? I've seen them on some websites, but I'm not aware of any cursor that prevents data input.

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Oeps, it is getting late and I did mis the question. But in the rebound, I used the follow code on my combox. Seems to work. Combox locked for editing, but still able to select an item.

Code:
Private Sub Combo14_KeyDown(KeyCode As Integer, Shift As Integer)
    Me.Combo14.Locked = True
End Sub

Private Sub Combo14_KeyUp(KeyCode As Integer, Shift As Integer)
    Me.Combo14.Locked = False
End Sub

Pampers [afro]
Keeping it simple can be complicated
 
scking . . .

[ol][li]In form design view set the forms [blue]Allow Edits[/blue] property to [blue]No[/blue].[/li]
[li]Next, for the controls you wish to allow editing set the following events . . .
Code:
[blue]Private Sub [purple][b]ControlName[/b][/purple]_GotFocus()
   Me.AllowEdits = True
End Sub

Private Sub [purple][b]ControlName[/b][/purple]_LostFocus()
   Me.AllowEdits = False
End Sub[/blue]
[/li]
[li]Save & close the form . . .[/li][/ol]
. . . and there's no need to change the cursor! . . .

Calvin.gif
See Ya! . . . . . .
 
Thanks TheAceMan1 and pampers. I've been using Access since it was first release and there are still situations coming up new where I can learn from others experience. Thanks.

---------------------
scking@arinc.com
---------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top