General information
Category:
Coding, syntax & commands
I agree with Naomi that you should design the form visually with CREATE/MODIFY FORM and then DO FORM...........
But........If you really want to define everything in code...........
Does it help to define the Desktop (or ShowWindow) property inside the DEFINE CLASS statement rather than changing oFrm???
(see changes below)
>Ok this is all working now except for the desktop .t. part. I would like this form to appear outside the vfp window and i keep getting an error saying "property desktop is read-only"
>What am i missing?
>k
>
>LOCAL oFrm
>
>oFrm= createOBJECT("Rooms")
>oFrm.Top = 24
>oFrm.Left =400
>oFrm.Height = 373
>oFrm.Width = 500
>*** oFrm.desktop = .t. moved to class definition
>
>oFrm.edit1.value = filetostr('sample.TXT')
>
>
>oFrm.Show(1)
>
>************************************
>DEFINE CLASS classrooms AS Form
>
>
> ADD OBJECT Edit1 AS EditBox WITH ;
> FontSize = 7.5, ;
> Height= 409, ;
> Left= 2, ;
> fontname='Lucida Console', ;
> ReadOnly= .t., ;
> TabIndex= 2, ;
> Top= 2, ;
> Width= 489, ;
> 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
>
>
>oFrm.hide(1)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only