#87400 - 2002-08-25 06:33 PM
Re: Kixforms: Enable and Textbox
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Was just experimenting with the VB TextBox ...
1) Disabling the TextBox turns the text grey. It does not accept or respond to any mouse or keyboard input. Setting the ForeColor of the text doesn't help - its still grey.
2) Locking the TextBox just makes the TextBox read-only. It still "responds" to mouse clicks and keyboard input - just that you can't add or delete or change any of the contents.
If I was needing something like a disabled textbox - but without the grey - I would tend to use a Label that looks like a textbox, example:
code:
; ; KIXTART 4.0 ; KIXFORMS 2.0.3 ; Break On $Form = CreateObject("Kixtart.Form") $Form.FontSize = 10 $Form.Center $Label = $Form.Label $Label.Size = 200,200 $Label.Center $Label.BackColor = 255,255,255 $Label.BorderStyle = 2 $Label.Text = "Currently running:" + @CRLF $Label.Text = $Label.Text + " Kixtart Version : " + @KIX + @CRLF $Label.Text = $Label.Text + " Kixforms Version : " + $Form.Version $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1
-Shawn [ 25. August 2002, 18:37: Message edited by: Shawn ]
|
Top
|
|
|
|
#87401 - 2002-08-28 02:03 PM
Re: Kixforms: Enable and Textbox
|
Borte
Fresh Scripter
Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
|
Shawn:
If I try this in VBA (don't have VB on this machine but as far as i know the function are the same)
1) Disabling the TextBox turns the text grey. It does not accept or respond to any mouse or keyboard input. Setting the ForeColor of the text doesn't help - its still grey. - Same reponse as i get
2) Locking the TextBox just makes the TextBox read-only. It still "responds" to mouse clicks and keyboard input - just that you can't add or delete or change any of the contents. - Same reponse as i get
3) Disabling AND locking the textbox makes the textbox read only without the grey, just like an label.
If needed contact me for an access example.
If I was needing something like a disabled textbox - but without the grey - I would tend to use a Label that looks like a textbox. - I agree to the point that you could use a label, but that's not good for showing more text than the label can handle to the user.
Here's an sample of the VBA code that produces the function (taken from access):
code:
Private Sub Commando8_Click() If Me.Text6.Enabled = True Then Me.Text6.Enabled = False Me.Commando8.Caption = "Disable" Else Me.Text6.Enabled = True Me.Commando8.Caption = "Enable" End If End Sub
Private Sub Commando9_Click() If Me.Text6.Locked = True Then Me.Text6.Locked = False Me.Commando9.Caption = "Lock" Else Me.Text6.Locked = True Me.Kommando9.Caption = "UnLock" End If End Sub
This is an form using one textbox (Text6) and two commandbuttons (Command8 and Command9). When pressing the different buttons the textbox cycles trough the different modes.
Borte
|
Top
|
|
|
|
#87403 - 2002-08-30 10:47 AM
Re: Kixforms: Enable and Textbox
|
Borte
Fresh Scripter
Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
|
I've just used this textbox function to display some information to the user, with the same "look" as the label field. The reason for why i'm jusing the textbox object and not the label is that the textbox object can hold much more text.
So if you're gonna show a lot of text to the user just as an information then the textbox with the "label" apperance is a good way to do this (at least that's my opinon), it also cleans up the form apperance i think.
What i've used this for in Kix is showing legal information to the user in the login form. This information is an total of 346 characters. I tried to put all this into the label object but it would only show the 2 first lines of text. So I had to use 4 seperate label fields placed alongside each other to solve this. If some one has any other way to do this then please tell me.
I'm not shure if this was the answer you were looking for Shawn but i've tried to explain how i've used it before.
|
Top
|
|
|
|
#87404 - 2002-09-03 02:46 AM
Re: Kixforms: Enable and Textbox
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
The label object "should" be able to show more than 346 chars of data, im thinking maybe its more of a forms bug, than anything else. For example, here's a script that's displays the Kixforms README.TXT file from the latest distribution. Its approx. 848 chars ...
code:
Break On $Form = CreateObject("Kixtart.Form") $Form.FontSize = 8 $Form.Size = 600,600 $Label = $Form.Label $Label.Size = $Form.ClientWidth-20,$Form.ClientHeight-20 $Label.Location = 10,10 $Label.BorderStyle = 1 If Open(1,".\readme.txt") = 0 $Line = ReadLine(1) While @Error = 0 $Label.Text = $Label.Text + $Line + @CRLF $Line = ReadLine(1) Loop $=Close(1) Endif $Form.Center $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1
Can you post a snippet of code that demonstrates the specific problem .. the truncation that is ...
|
Top
|
|
|
|
#87407 - 2002-09-04 01:57 PM
Re: Kixforms: Enable and Textbox
|
Borte
Fresh Scripter
Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
|
Here's the code i've been using to show the legal text...:
code:
$Form = CreateObject("Kixtart.Form") $Form.Caption = "BLA BLA BLA..." $Form.ScaleHeight = 500 $Form.ScaleWidth = 550 $Form.FontName = "Arial" $Form.FontSize = 9 $Form.Center $Form.moveable = 0 $Form.ResizeAble = 0 $Form.showintaskbar = 1 $Form.TitleBar = 1 $Form.TopMost = 1 $Form.BorderStyle = 1 $Form.MaxButton = 0 $Form.MinButton = 0
Global $lblLegal[3] $lblLegal[0] = $form.label() $lblLegal[1] = $form.label() $lblLegal[2] = $form.label() $lblLegal[3] = $form.label()
For Each $Label in $lblLegal $Label.Alignment = 0 $Label.FontName = "arial" $Label.FontBold = 0 $Label.FontSize = 7 $Label.Left = $fraLegal.Left + 10 Next
$lblLegal[0].Text = "BLA BLA BLA BLA LINE 1..." $lblLegal[0].Top = $fraLegal.Top + 25 $lblLegal[0].Width = $fraLegal.Width - 20 $lblLegal[1].Text = "BLA BLA BLA BLA LINE 2..." $lblLegal[1].Top = $lblLegal[0].Height + $lblLegal[0].Top $lblLegal[1].Width = $fraLegal.Width - 20 $lblLegal[2].FontSize = 8 $lblLegal[2].Text = "BLA BLA BLA BLA LINE 3..." $lblLegal[2].Top = $lblLegal[1].Height + $lblLegal[1].Top + 5 $lblLegal[2].Width = $fraLegal.Width - 20
I've removed the text as it was in norwegian (didn't think it was of any use).
I'm also looking for a way to disable the close botton in the form. How do i do that without changing/removing the border?
Regards Borte
|
Top
|
|
|
|
#87409 - 2002-09-04 04:03 PM
Re: Kixforms: Enable and Textbox
|
Borte
Fresh Scripter
Registered: 2002-08-20
Posts: 29
Loc: Europe / Norway
|
I know, but i'm jusing it in a dynamic form with an progress bar during logon so the user can read this while he waits for the logon to complete.
Mostly just as an "neat" future...
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 515 anonymous users online.
|
|
|