Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Define class programmatically
Message
 
 
To
11/11/2003 23:39:57
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00848966
Message ID:
00848984
Views:
17
Paul,

modi class comdate of newlib

then Take the code and paste it into the appropriate methods. You'll have to use the Class, Edit Property/method menu item to create the assign method for the Value property.

>Thank you for your reply, but I unfortunately don't understand. what I am trying to do is use the following program:
>
>DEFINE CLASS comdate AS combobox
> FontSize = 8
> BoundColumn = 2
> ColumnCount = 2
> ColumnWidths = "175,80"
> RowSourceType = 1
> RowSource = "No Date, / / "
> Value = "/ /"
> Style = 2
> BoundTo = .T.
> StatusBarText = "Select the appropriate date from the pop-up calendar."
> ToolTipText = "Right-Click to blank date."
> Width = 110
> Name = "comdate"
> PROCEDURE value_assign
> LPARAMETERS ldDate
> This.RowSource=Iif(Empty(ldDate),"No Date",Left(CDow(ldDate),3)+" "+;
> Left(CMonth(ldDate),3)+;
> Str(Day(ldDate),3)+Str(Year(ldDate),5))+","+DToC(ldDate)
> THIS.VALUE = DToC(ldDate)
> ENDPROC
> PROCEDURE value_access
> RETURN CToD(This.Value)
> ENDPROC
> PROCEDURE RightClick
> This.Value={}
> NoDefault
> ENDPROC
> PROCEDURE MouseDown
> LParameters lnButton, lnShift, lnXCoord, lnYCoord
> Local laMousePos(4)
> If lnButton<>2.And.AMouseObj(laMousePos)=4.And.;
> Between(laMousePos(3),This.Left+This.Width-20,This.Left+This.Width)
> Local loFrm
> loFrm=CreateObject("frmCalendar")
> loFrm.UPSetup(This)
> loFrm.Show
> loFrm=""
> Release loFrm
> This.Refresh
> This.UPValid && calls the User defined valid method
> NoDefault && prevents the drop down list from showing
> EndIf
> ENDPROC
>ENDDEFINE
>
>This is from a universal thread faq, and it is supposed to provide a calendar when a person cliks on the drop down. If I add the following code to the beginning of the program:
>
>create classlib new_lib
>create class comdate of new_lib as combobox
>
>it creates a class library with a combobox in it, but when I add it to the form directly, nothing happens when I run the form and click on the combo box. Am I doing something wrong, or is the program incorrect for the calendar? Thanks again for your help.
>
>Paul
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform