Page 1 of 2 12>
Topic Options
#87379 - 2002-08-22 07:16 AM Kixforms: Enable and Textbox
Redback Offline
Getting the hang of it

Registered: 2002-03-20
Posts: 71
Loc: Albury Wodonga, Australia
I have a textbox that I would like to display information in, I would like to prevent users from interacting with this text box, however I would like to do this without the textbox becoming 'grayed out'

anyone know of a way to do this?

suggestions on alternative ways to display this text will also be gratefully received

Thanks

Redback

Top
#87380 - 2002-08-22 07:48 AM Re: Kixforms: Enable and Textbox
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
I'd like to know the same about ComboBox. Disable a ComboBox and you can no longer select from the list.
Top
#87381 - 2002-08-22 08:59 AM Re: Kixforms: Enable and Textbox
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
Redback,

For a textbox the property Locked should work. According to the manual this property is only for Textboxes. Maybe Shawn can add this also to ComboBox in future releases.
_________________________
Kind regards,

Top
#87382 - 2002-08-22 10:11 AM Re: Kixforms: Enable and Textbox
Fernando Madruga Offline
Starting to like KiXtart

Registered: 2002-08-21
Posts: 149
Loc: Coimbra.Portugal.Europe.Earth....
If you don't mind me asking: what's the point of having a "read-only" ComboBox? [Confused] If the user can't change the value, there's no point in letting him/her know what they are: (s)he can do nothing about it! [Smile]

Just curious,
Fernando Madruga
_________________________
Later,   [b]Mad[/b]ruga

Top
#87383 - 2002-08-23 12:59 AM Re: Kixforms: Enable and Textbox
Borte Offline
Fresh Scripter

Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
I've posted this for a couple of days ago in this forum (another topic):

In VB is it possible to set an txtbox as enabled to false and locked to true to get a textbox look like an label, but with all the properties of an textbox. Is this possible in KixForms?
I've tried to achive this but the textbox is always ending up with the text grayed out.

The function would be fullfilled if the forecolor of this textbox didn't change to gray but stayed the same if the value locked is true and enabled is false.

Any ideas? [Confused]

I'm trying to show information to the user, but the text is to big to fit in one label field so i have to use multiple labels. Not a good solution!

Regards
Borte!

Top
#87384 - 2002-08-22 01:03 PM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
borte, haven't tried, but have you tried to set the background color after disabling it?

well, I did something similar on my user creation script but it uses listbox instead.
_________________________
!

download KiXnet

Top
#87385 - 2002-08-22 01:08 PM Re: Kixforms: Enable and Textbox
Borte Offline
Fresh Scripter

Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
Yes i've changed the backcolor to the forms color before locking it. When doing that the backcolor stays the same but the forecolor is grayed out.

I't would have been great to be able to use this function to show dynamically text to the user, instead of using labels!

Can listbox be disabled and still show text in normal color? I don't want the user to be able to select the text only read it.

Top
#87386 - 2002-08-22 01:27 PM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, user can still select it as I don't set it to not enabled.

but you can make event for it or the textbox you are using.

$listbox.ongotfocus="$$form.setfocus()"

then, any time user selects it, it get unselected.

give it a try.

cheers
_________________________
!

download KiXnet

Top
#87387 - 2002-08-22 02:48 PM Re: Kixforms: Enable and Textbox
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Fernando Madruga,

I'm not exactly sure what your asking. As is the combobox lets you edit the text in the drop down list. I want to disable being able to edit any of these values. Just to be sure were on the same sheet of music, I'm looking to make the combobox act the same as the Hop To: combobox on the bottom right of this webpage.

Top
#87388 - 2002-08-22 02:51 PM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
vig, that's why some of us are waiting for shawn to add menubox.

haven't actually heard about that for a while, but as I understood, such should be added.

.
_________________________
!

download KiXnet

Top
#87389 - 2002-08-22 03:00 PM Re: Kixforms: Enable and Textbox
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
To keep the textbox text from changing couldn't you also use OnChange to set it back to the original text?

Something like:

$listbox.text = "Your Text"
$listbox.onchange = '$$listbox.text = "Your Text"'

Hmm nevermind that seems to throw it into a loop.

Top
#87390 - 2002-08-22 03:03 PM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no, as listbox is not changeable.

it's only selectable. that's why removing the chance to select anything is easy to remove by taking of the focus.
it also trickers before onchange.

also, onclick is one way.
_________________________
!

download KiXnet

Top
#87391 - 2002-08-22 03:27 PM Re: Kixforms: Enable and Textbox
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Oops, sorry thought we were talking about a textbox.
Top
#87392 - 2002-08-22 03:33 PM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
but, actually, the box is not needed to be disabled as it can be made as disabled with those nice events.
_________________________
!

download KiXnet

Top
#87393 - 2002-08-22 04:00 PM Re: Kixforms: Enable and Textbox
Borte Offline
Fresh Scripter

Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
But the cursor will still change to tell the user that this field can be edited!
Top
#87394 - 2002-08-22 04:40 PM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the cursor will change?
to what?

my cursor only changes to "I" which does not tell anything but that it's on text.
_________________________
!

download KiXnet

Top
#87395 - 2002-08-22 05:23 PM Re: Kixforms: Enable and Textbox
Borte Offline
Fresh Scripter

Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
Yes that's correct.

In VB if you set locked = True and Enabled = False will the cursor for the textbox not change to "I" and therefore not give any hint to the user that this field can be edited or selected (of course it can't be edited or selected because its locked and disabled)

Top
#87396 - 2002-08-22 05:30 PM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, it's vb.

if you move your mouse over normal text on the forum, you see that it's cursor changes.

it's just normal behaviour with normal text.

I don't think your users think that:
"hey, this can be changed"
because the cursor change happens.
_________________________
!

download KiXnet

Top
#87397 - 2002-08-23 01:29 AM Re: Kixforms: Enable and Textbox
Redback Offline
Getting the hang of it

Registered: 2002-03-20
Posts: 71
Loc: Albury Wodonga, Australia
This works for me

$text.locked = 1

its not in the online manual though....

thanks Schuliebug

anyone know how to center the text in the box?

Top
#87398 - 2002-08-23 02:05 AM Re: Kixforms: Enable and Textbox
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
center text in text box.

I think it's only matter of simple calculation.

actually, I had some time ago login script with centered text and it looked really stupid.

anyway, all you need to know is the width and count the center point (/2) of the box and text...

well, you know.
as I know of, there is no method in forms itself.
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.076 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org