Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Gerald Fay
  Where is Gerald Fay?
 Olympia
 Washington - United States
 Gerald Fay
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Newbee and AddProperty form method
Thread ID: 288908 Message ID: 288923 # Views: 55 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Sunday, December 26, 2010 6:33:49 PM         
   


Stefan,

I did find the addproperty button on the IDE menu form option.
Now I understand the Propterty Viewer "addpropery" is a method called when the form runs addproperty. This was very confusing, and you helped me to finally see it!

The easiest solution is, as you said, to choose option 1 for the combobox rowset

Now I need to move on to city. Since there are so many I will try running a Select Distinct SQL statement on the Customer Information database city field and store this to an array. I will use the array as the city combobox rowset. I will have to add a "Not Found" option and have the form open an entry field to enter a new city if that is selected.

To populate the array do you place the code in the form init or do you use a combobox method?

Thank you so much for your help!


> > Very new to this. Previously programed in Visual Dbase where every bit of code was created by me.
> > I am working on updating an old foxpro 2.5 program which still works well after 20 years, but it is dying in Windows7 XP mode.
> >
> > I have created a form which connects to a database of demographic customer information.
> > There are at least 4 separate data fields for "State" that are required.
> >
> > I would like to create an array that has listed every state, and would like to have that array availabe to a combobox (4 of them) with the array as the rowsource. It would seem best to initiate the array in the form.
> >
> > Most internet sites reference older versions of Foxpro that suggest clicking on the form properties and then clicking on the addproperty method. This should then prompt for a name for the property.
> > Instead in Foxpro 9 it opens a snippet box with the following:
> >
> > LPARAMETERS cPropertyName, eNewValue, nVisiblity, cDescription
> >
> >
> > What do I do next?
> >
> > The array will be called astates
> > I would like to populate the array with a comma delimited text string "Ak,Al,Ca,Co" etc...
> > Do I populate the array in the addproperty method, or should I just do all of this in the init method of the form?
> >
> > Thanks for your help.
>
>
> You can add custom form properties in the IDE menu -> "Form" -> "New Property...", and then type astates[1]
>
> (Whereas double-clicking the AddProperty method in the Properties window would open the Code Editor so that you can write code that would always run when the AddProperty event runs)
>
> An alternate option might be running custom code in yourCombo.Init():
>
This.AddProperty('aStates[4]')
> Store 'Ak' To This.aStates[1]
> Store 'Al' To This.aStates[2] && and so on
> 

>
> Or perhaps even easier?: make yourCombo.RowSourceType=1, and yourCombo.RowSource="Ak,Al,Ca,Co" (w/o quotes) directly in the Properties window.
>
>
>
> hth
> -Stefan

ENTIRE THREAD

Newbee and AddProperty form method Posted by Gerald Fay @ 12/25/2010 9:27:55 PM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/25/2010 11:15:20 PM
RE: Newbee and AddProperty form method Posted by Gerald Fay @ 12/26/2010 6:33:49 PM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/26/2010 9:02:07 PM
RE: Newbee and AddProperty form method Posted by Samir H. @ 12/27/2010 2:22:52 AM
RE: Newbee and AddProperty form method Posted by tushar @ 12/27/2010 5:11:48 AM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/27/2010 10:56:04 AM
RE: Newbee and AddProperty form method Posted by Samir H. @ 12/27/2010 11:57:12 AM
RE: Newbee and AddProperty form method Posted by Ony Too @ 12/27/2010 2:13:01 PM
RE: Newbee and AddProperty form method Posted by Samir H. @ 12/27/2010 2:56:32 PM
RE: Newbee and AddProperty form method Posted by Ony Too @ 12/28/2010 6:36:49 AM
RE: Newbee and AddProperty form method Posted by Samir H. @ 12/28/2010 8:03:04 AM
RE: Newbee and AddProperty form method Posted by Cetin Basoz @ 12/27/2010 10:59:11 AM
RE: Newbee and AddProperty form method Posted by Samir H. @ 12/27/2010 11:54:00 AM
RE: Newbee and AddProperty form method Posted by Cetin Basoz @ 12/27/2010 6:04:34 PM
RE: Newbee and AddProperty form method Posted by Gerald Fay @ 12/27/2010 7:08:38 AM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/27/2010 11:25:32 AM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/28/2010 3:40:59 AM
RE: Newbee and AddProperty form method Posted by Samir H. @ 12/28/2010 3:54:37 AM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/28/2010 7:33:01 AM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/28/2010 8:05:48 AM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/28/2010 10:28:42 AM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/29/2010 12:19:48 AM
RE: Newbee and AddProperty form method Posted by Cetin Basoz @ 12/29/2010 1:41:27 AM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/29/2010 2:11:57 AM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/29/2010 2:20:14 PM
RE: Newbee and AddProperty form method Posted by Cetin Basoz @ 12/29/2010 2:39:39 PM
RE: Newbee and AddProperty form method Posted by Samir H. @ 12/29/2010 3:08:48 PM
RE: Newbee and AddProperty form method Posted by Cetin Basoz @ 12/30/2010 9:32:09 AM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/29/2010 11:42:07 PM
RE: Newbee and AddProperty form method Posted by Gerald Fay @ 12/28/2010 8:25:03 AM
RE: Newbee and AddProperty form method Posted by Stefan Wuebbe @ 12/28/2010 10:31:14 AM
RE: Newbee and AddProperty form method Posted by Ony Too @ 12/26/2010 6:00:33 AM
RE: Newbee and AddProperty form method Posted by Gerald Fay @ 12/27/2010 2:01:43 AM
RE: Newbee and AddProperty form method Posted by Cetin Basoz @ 12/27/2010 10:51:52 AM
RE: Newbee and AddProperty form method Posted by Anders Altberg @ 12/26/2010 7:20:37 PM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/28/2010 3:44:21 AM
RE: Newbee and AddProperty form method Posted by Gerald Fay @ 12/28/2010 8:55:49 AM
RE: Newbee and AddProperty form method Posted by Anders Altberg @ 12/29/2010 5:23:29 PM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/29/2010 11:57:08 PM
RE: Newbee and AddProperty form method Posted by Anders Altberg @ 12/30/2010 10:12:32 AM
RE: Newbee and AddProperty form method Posted by Jun Tangunan @ 12/28/2010 6:31:22 AM
RE: Newbee and AddProperty form method Posted by Gerald Fay @ 12/28/2010 8:37:18 AM
RE: Newbee and AddProperty form method Posted by Ron Seidl @ 2/16/2014 4:54:41 PM