LOCAL oFrm oFrm= createOBJECT("classRooms") oFrm.Top = 24 oFrm.left = 1420-meslen && will keep right border assuming 1440 screen width oFrm.Height = 573 oFrm.Width = meslen oForm.Edit1.Width = meslen-5You don't need to clear class for your case.
>mes = '00c00mm.TXT' &&& this text is variable otheres have variable widths > >lnmaxlength =0 >DO LENTEST && test length of text file (Al Doman's program) > >MESLEN = lnmaxlength >meslen= (meslen*7.2)+18 &&&(convets character to pixels + window screen size) > > > > >****** oFrm.desktop = .t. moved to class definition > >oFrm.edit1.value = filetostr(mes) > > >oFrm.Show(1) > > > >************************************ >DEFINE CLASS classrooms AS Form > > > ADD OBJECT Edit1 AS EditBox WITH ; > FontSize = 8, ; > FontStyle = 'n', ; > Height= 550, ; > Left= 2, ; > fontname='lucida console', ; > ReadOnly= .t., ; > TabIndex= 2, ; > Top= 2, ; > Width= meslen-5, ; > Value= "" > desktop = .t. &&& moved from setting oFrm >ENDDEFINE > > >Public Event MouseWheel As MouseWheelEventHandler > >PROCEDURE Object.MouseWheel >LPARAMETERS nDirection, nShift, nXCoord, nYCoord > > >PROCEDURE edit1.MouseWheel > LPARAMETERS nDirection, nShift, nXCoord, nYCoord > > * Set focus to this control > If Type("thisform.ActiveControl") # "O" or thisform.ActiveControl < > this > this.SetFocus > EndIf > > ENDPROC > >Object.RemoveObject(edit1) >oFrm.hide(1) > > >PROC LENTEST >CREATE CURSOR LengthTest ; > ( LineChars C( 254 ) ) >APPEND FROM &MES TYPE SDF >CALCULATE MAX( LEN( TRIM( LengthTest.LineChars ) ) ) TO lnMaxLength >USE IN LengthTest