Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Short Editboxes
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00735373
Message ID:
00735469
Views:
8
It seems that the height you want to set is less than the value allowed. Try to compare the height with that when Integralheight is .t. Try something like below in the timer procedure:

for ia=1 to 3
lccontrol="THISFORM.edt"+alltr(str(ia))
with &lccontrol

lnheight=.Height
.integralheight=.t.
lnintegralheight=.Height
.integralheight=.f.
.Height =lnheight

if lnintegralheight .Height = .Height - 1
endif
endwith
endfor




>I have an editbox that gets resized (height only) based on the amount of text it is going to contain. When the editbox is quite short, it displays text strangely - the alignment gets thrown off and you can select & drag the text and it will scroll sideways out of the editbox.
>
>It seems that the problem happens when the editbox shorter than 2 full lines of text. I can probably just swap in a textbox for these cases, but I'm wondering if this is a known issue with editboxes and if there's a workaround.
>
>I'm getting this behaviour in VFP 7 and the 8 beta. Here's an example:
>
>[PRE]
>oForm = CreateObject("MyForm")
>oForm.Show()
>
>******************************************
>DEFINE CLASS MyForm AS Form
>
> Width = 550
> Height = 170
> Caption = "Edit Boxes"
> WindowType = 1
>
> ADD OBJECT edt1 AS EditBox ;
> WITH Top = 25, ;
> Left = 25, ;
> Width = 150, ;
> Height = 70, ;
> Alignment = 0, ;
> Value = "Some Text", ;
> FontSize = 16
>
> ADD OBJECT edt2 AS EditBox ;
> WITH Top = 25, ;
> Left = 200, ;
> Width = 150, ;
> Height = 70, ;
> Alignment = 1, ;
> Value = "Some Text", ;
> FontSize = 16
>
> ADD OBJECT edt3 AS EditBox ;
> WITH Top = 25, ;
> Left = 375, ;
> Width = 150, ;
> Height = 70, ;
> Alignment = 2, ;
> Value = "Some Text", ;
> FontSize = 16
>
> ADD OBJECT cmdStart as CommandButton ;
> WITH Top = 125, ;
> Left = 150, ;
> Height = 25, ;
> Width = 100, ;
> Caption = "Start"
>
> ADD OBJECT cmdStop as CommandButton ;
> WITH Top = 125, ;
> Left = 300, ;
> Height = 25, ;
> Width = 100, ;
> Caption = "Stop"
>
> ADD OBJECT tmr1 AS Timer ;
> WITH Interval = 0
>
> PROCEDURE cmdStart.Click
> THISFORM.edt1.Height = 70
> THISFORM.edt2.Height = 70
> THISFORM.edt3.Height = 70
> THISFORM.tmr1.Interval = 100
> ENDPROC
>
> PROCEDURE cmdStop.Click
> THISFORM.tmr1.Interval = 0
> ENDPROC
>
> PROCEDURE tmr1.Timer
> THISFORM.edt1.Height = THISFORM.edt1.Height - 1
> THISFORM.edt2.Height = THISFORM.edt2.Height - 1
> THISFORM.edt3.Height = THISFORM.edt3.Height - 1
> ENDPROC
>
>ENDDEFINE
>[/PRE]
Previous
Reply
Map
View

Click here to load this message in the networking platform