Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What are the major collections in Visual Fox 4

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
0
0
US
I have done mostly VBA and Access where I would spin through the collections regularly (eg to spin through all of the controls of a form I would do something like this):

Dim ctl As Control

For Each ctl In Me.Controls
Debug.Print ctl.Name
Next ctl

I am helping in a shop going gradually to Visual from FoxPro2.6 and even FoxPro DOS. The folks there don't seem to be using the collections very much and I would like to help them get started as I think it would be a great benefit to them to do so.

Are there Visual Fox collections similar to Forms, TableDefs, QueryDefs, Properties, Controls, Documents, etc? Would someone be kind enough to post a bit of code showing how to spin through them?

Thanks in advance for any help you can give me!

 
Hi,

Here is some code from the "txtbtns" object of the "wizstyle" class. This code is right out of the "setallprop" method. This method is run whenever a form is opened that is based on the wizstyle classlib. It step through each object making up the form and set each object fore and back color based on whether the form is in edit mode or not. If you would like to try it out, place a "set step on" command in the setallprop method and create watch variable to see how this code works.

********************************************************

LPARAMETER oContainer

* Checks for General fields
LOCAL i,oControlParent,nCtrlCount

IF PARAMETERS() = 0
m.oControlParent = THISFORM
ELSE
m.oControlParent = m.oContainer
ENDIF

DO CASE
CASE ATC("Pageframe",m.oControlParent.BaseClass)#0
nCtrlCount = oControlParent.PageCount
CASE ATC(m.oControlParent.BaseClass,"Optiongroup,Commandgroup")#0
nCtrlCount = oControlParent.ButtonCount
OTHERWISE
nCtrlCount = oControlParent.ControlCount
ENDCASE

FOR i = 1 TO m.nCtrlCount
DO CASE
CASE ATC("Pageframe",m.oControlParent.BaseClass)#0
THIS.SetAllProp(m.oControlParent.Pages[m.i])

CASE ATC(m.oControlParent.BaseClass,"Optiongroup,Commandgroup")#0 AND ;
THIS.UserControlMode
m.oControlParent.Buttons[m.i].Enabled = THIS.EditMode

CASE ATC(m.oControlParent.Controls[m.i].BaseClass,"Optiongroup,Commandgroup")#0 ;
AND THIS.UserControlMode
THIS.SetAllProp(m.oControlParent.Controls[m.i])

CASE ATC("Container",m.oControlParent.Controls[m.i].BaseClass) # 0 OR;
ATC("Page",m.oControlParent.Controls[m.i].BaseClass) # 0
THIS.SetAllProp(m.oControlParent.Controls[m.i])

CASE ATC(m.oControlParent.Controls[m.i].BaseClass,"ListBox,ComboBox,Spinner") # 0 AND;
THIS.UserControlMode
m.oControlParent.Controls[m.i].Enabled = THIS.EditMode

CASE ATC(m.oControlParent.Controls[m.i].BaseClass,"CheckBox,TextBox,OleBoundControl") # 0
m.oControlParent.Controls[m.i].Enabled = THIS.EditMode

CASE ATC(m.oControlParent.Controls[m.i].BaseClass,"EditBox") # 0
m.oControlParent.Controls[m.i].ReadOnly = !THIS.EditMode
IF !THIS.HasMemo
WITH m.oControlParent.Controls[m.i]
THIS.EditForeColor = .ForeColor
THIS.EditDisForeColor = .DisabledForeColor
THIS.EditBackColor = .BackColor
THIS.EditDisBackColor = .DisabledBackColor
THIS.HasMemo = .T.
ENDWITH
ENDIF
m.oControlParent.Controls[m.i].ForeColor = IIF(THIS.EditMode,THIS.EditForeColor,THIS.EditDisForeColor)
m.oControlParent.Controls[m.i].BackColor = IIF(THIS.EditMode,THIS.EditBackColor,THIS.EditDisBackColor)

CASE ATC(m.oControlParent.Controls[m.i].BaseClass,"Grid") # 0
m.oControlParent.Controls[m.i].ReadOnly = !THIS.EditMode
* m.oControlParent.Controls[m.i].DeleteMark = THIS.EditMode

ENDCASE
ENDFOR

**************************************************

Notice the key to this code is ".oControlParent = THISFORM", which creates an object oControlParent that when expanded hold every property, basefore, editbox, label, textbox, page, pageframe, etc that makes up the form.

LelandJ


Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Some of the collections you're looking for are:

_SCREEN.Forms : All forms in the application that have been instantiated (not all form definitions, like in most VB apps, but only after DO FORM, or CreateObject...Show)

{ContainerObject}.Controls : All controls directly contained by this containerObject. Container objects include: Form, Container, Control, Page, Column

{CommandGroupObject}.Buttons : all buttons in a commandbutton group

{OptionGroupObject}.Buttons : all radio buttons in an optionButton group

{pageFrameObject}.Pages : all pages in a pageframe

{gridObject}.Columns : all columns in a grid object


To be honest, the SetAll property of most container-like controls is usually more useful than spinning through with FOR EACH, particularly since it's fast and can filter by classname (eg to only operate on textboxes, etc).

Also, beware that VFP supports nested containership, which is much less common in VB, so all the controls in a form won't show up in the FORM.Controls collection, if they happen to be contained in a Page or a Container, etc.
 
Hey, this is great stuff, exactly the type of thing I was looking for! A star for both of you is in order.

If you don't mind, here are a couple followup questions based on your responses above. By the way, they do have a Hackers link on my desktop, although I haven't had a chance to play with it very much as all of this is outside the scope of what I am supposed to be doing for them.

Please bear with me as I do not have access to Visual Fox except while at work.

Leland123

1. Is SetAllProps one of the event methods associated with a form? If so, is it part of the load or init events? If not, where do I find it so I can paste in code like the above?

2. Is wizstyle classlib the default form type if I create a new form? If not, should it be?

3. I think I understand your first Case statement. It looks like you are checking for controls that are themselves containers (eg PageFrames and OptionGroups). Are there subforms in Visual Fox?

4. What is the ATC function?

wgcs

1. Thanks especially for your last statement about nested containers. That one would have bitten me for sure.

2. As an example, say we had 6 check boxes on a form that controlled processing, 5 were for individual plants and one was for all plants. In Access VBA I would do something like the following depending on whether I was checking the control name or the caption:

Dim ctl As Control
'Process open form named Form1
For Each ctl In Forms("Form1").Controls
If IsNumeric(ctl.Name) Or IsNumeric(ctl.Caption) Then
ctl.Value = False
End If
Next ctl

Actually, I would verify that the control was a checkbox before I did the above but I was trying to shorten the example. How would you to the above with the SetAll property you referenced above? Say if a control named DoAll was checked, how would you check all the numeric checkboxes, say 501, 502, 503, 504 and 505?

Thanks again for your help! What you have done already is very, very helpful!

Have a great weekend!


 
1. Is SetAllProps one of the event methods associated with a form?
Yes... it's actually "SetAll", and is used like this:
FORM.SetAll( "PropertyName", "NewValue", "ClassName" )
The classname is optional, the NewValue should be of the appropriate type for the property, and this works on all the containers, AFIK.

If so, is it part of the load or init events? If not, where do I find it so I can paste in code like the above?
It's really a Method, not an event. You can use it anytime you have an object reference to the form. (In any form method, THISFORM is an object reference to the form. You can also get an object reference using the _SCREEN.Forms collection, among other ways)

2. Is wizstyle classlib the default form type if I create a new form? If not, should it be?
This is a subjective question... I have never used WizStyle as a form class: I maintain my own classes for forms, and never have a "Default" form type set. I store all my forms as classes, and instantiate them through CREATEOBJECT() or NEWOBJECT() instead of DO FORM....

3. I think I understand your first Case statement. It looks like you are checking for controls that are themselves containers (eg PageFrames and OptionGroups). Are there subforms in Visual Fox?

No. VFP doesn't do SubForms the way Access does at all. Instead, you'd probably use the Grid control.

4. What is the ATC function?
"Case insensitive AT()". Similar to InStr$( ucase(cInStrin), cSearchFor )

1. Thanks especially for your last statement about nested containers. That one would have bitten me for sure.
You're welcome!

2. As an example, . . . 'Process open form named Form1
. . . Say if a control named DoAll was checked, how would you check all the numeric checkboxes, say 501, 502, 503, 504 and 505?


Ok, SetAll is great, but has some limitations: mainly, it always operates on Every object in a container (or, if a class is specified, every object of that class).

Which would work to check ALL checkboxes, say, if a button were pushed, or if one checkbox were checked, but if it's not an All-or-nothing situation, then SetAll doesn't help much. One approach would be to have a checkbox on the form named chkSetAll, then have a container (say, cntOptions) on the form that contains all the CheckBoxes that should be auto-checked. In that case, you would do this:

o Create a form called whatever you want.
o Put on it a checkbox named chkSetAll
o Put on the form, a container and name it cntOptions
o Right-click the container, then choose "Edit" from the shortcut menu (in VFP7+ you can just Ctrl+Click the container)
o Add checkboxes to the container called chk501, chk502, chk503, etc.
o In the InteractiveChange event of chkSetAll, put this code:
Code:
if THIS.Value
  THISFORM.cntOptions.SetAll( "Value", .T., "CheckBox" )
endif

( to get it to auto-uncheck all the options when you Uncheck the chkSetAll, use this instead:

Code:
THISFORM.cntOptions.SetAll( "Value", THIS.Value, "CheckBox" )

)


As a hint, too, it is common in VFP to use the ControlSource property of a control to point it to a custom Form property, (say "THISFORM.cFirstName"), then refer to that form property, rather than to refer to something like THISFORM.cntPersonInfo.cntNames.txtFirstName.Value in code.

ControlSource is particularly useful if you're binding the form's controls directly to fields in a table, in which case when the user edits the control, the table is automatically updated.
 
Sorry for butting in.

1. Is SetAllProps one of the event methods associated with a form? If so, is it part of the load or init events? If not, where do I find it so I can paste in code like the above?

No, it’s a method associated with the commandgroup called "txtbtns" in the wzbtns class library. And the other commandgroups in that library derive from that class. But you can find the code in the txtbtns.

Is wizstyle classlib the default form type if I create a new form? If not, should it be?

No, when you create a form using File->New form, you are using VFP's default baseclass, but if you change in the Tools_.Options->Forms Template class to wizstyle, then it will use the baseform form the wizstyle class library. Different people might have different ideas, but the code found in the wizstyle in good to study, I would not recommend you use it for your own project. The problem is they work when all elements are present as they are intrinsically linked but as soon as you want to change something (which will be the case most of the time), you end up "breaking" the code.

What is the ATC function?

Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, without regard for the case of these two expressions.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
SBendBuckeye

A word a caution also if you choose to create a form with the form wizard, you will find that if you decide to add an additional control on your form after the fact, you will notice that the "enable/disabled" effect will not work on the new control unless you use the wystyle type control. Since the code looks for the wizstyle class to perform on.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks, Mike; I'm unfamiliar with the wzbtns/wizstyle classes, so I didn't recognize that as where SetAllProps came from, and I had missed that reference in Leland's post.

SBendBuckeye, Leland was pointing out a good way to learn in VFP... Looking at existing code to see how it works. This can be confusing sometimes, though, because many of the tools that came with VFP are (almost) over-engineered (since they are designed for extreme flexibility), and therefore often get very complex to try to determine how they work...

You might find the FoxWiki a good place to browse around, too: If you go to this URL
you'll get a list of almost 200 topics with regular (as opposed to highly-engineered) code samples to give you an Idea of ways of doing things.
 
You guys are great! That's why I love Tek-Tips. Quick and knowledgeable responses that help you out immediately. I'll check out the URLs above as soon as I can.

I'm a little bit confused about how or where you setup or call the methods referenced above. In Access, you can write method specific code by selecting whatever method you wish to react to from a form or control's properties. It then creates a procedure header and End Sub statement for you and you drop your code inside of it and you are done.

I understand the difference between methods, properties and events, I'm just not sure yet where in the Visual Fox developement environment I look for these things.

Thanks again for all of the great answers!

 
I understand the difference between methods, properties and events, I'm just not sure yet where in the Visual Fox developement environment I look for these things.

There are a fews ways to create a method.
1. Visually (in a form for example). In design mode for the form, from the menu, Form->New method (call it whatever you want, and it will place itself as a last item in the property sheet.
You woudl call for it like this:
THISFORM.mymethod()
2. Via code:
DEFINE CLASS myClass as custom
PROCEDURE myMethod
messagebox("Hello World")
ENDPROC
ENDDEFINE

You would have to create an instance of the class first in this case in order to use the method;
PUBLIC omyFunc
oMyFunc = CREATEOBJECT("myClass")
oMyFunc.myMethod()

The advantage with the second way, is if you don't destroy it (as you woudl when you close a form), you can resuse it Anywhere in the application. I use these as global procedure, like holding the username a password, to check for enbaling certain accesses in the application.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi,

Sorry, I got pulled off and am just getting back to the thread.


1. Is SetAllProps one of the event methods associated with a form? If so, is it part of the load or init events? If not, where do I find it so I can paste in code like the above?

The SetAllProps is a method in the basefore wizstyle class. It is called from the init event of the base class. The init event of the baseform also call many other method right in a row. Since this code exits at the base form level, every from sub-classed from wizstyle inherite it. This mean every time you open a form base on wizstyle class, this code is run.

setall is a procedure which about every object on a form possesses. Other porcedure an object, like a TEXTBOX, might have are click, when, valid, gotfocus, lostfocus, setall, etc. These procedure/events fire in a predetermined order and are available to hold VFP code. Most container also have a setall procedure/events.

The objects on a form can be accessed much like a directory in a file system. I could open a database by calling it based on its path of c:\myprogram\data\test.dbf, for example. Object on a form can be accessed in much the same manner like thisform.page.pageframe1.grid11.readonly = .F. The code in the setallprop method is walking down the object tree with "THISFORM" object as the root of the tree. When it find a container like thisform.pageframe1.page2, it is using the setall function to address collections that are on the container. In the setall function you specify what collection you want to address, for example to set the back color off all "TEXTBOX" within "thisform.pageframe1.page2" to a particular color. The "THISFORM" object has a root with subdirectories just like a file system.

2. Is wizstyle classlib the default form type if I create a new form? If not, should it be?

Wizstyle classlib is a very special class. It is used by the VFP wizard to create forms. It is one of the main classes in my accounting application project. Wizstyle holds all the base functionality need to build a form like textboxes, grids, pageframes, comboboxes, etc. I do not like to distrube this class at a base level. This allow me to drap at textbox, for example, from wizstyle classlib which is located in my project, and place the textbox object on the form. At this point the textbox has little functionality other than a base set of empty properties, as shape, a location within the container, etc. It is by adding values to the properties, code to the method and procedures/events that textbox becomes a living thing which I create. If too much detail code is entered at a base level, the class will become ridged and difficult to customize/subclass with changes at the form level. However, if I place code in the base textbox, to give it a blue background for example, every textbox on every form in may project would inherite a blue background. This is why we say Visual FoxPro supports inheritance, which is a powerful tool.

3. I think I understand your first Case statement. It looks like you are checking for controls that are themselves containers (eg PageFrames and OptionGroups). Are there subforms in Visual Fox?

The code is searching for cantainer within the form. The form itself is also a container. The cantainers are object of the wizstyle class. They wizstyle base container can be placed on a form and inherite everything in the base container. However, the code in the base container can be overriden by place you own code in the form. This is called sub-classing.

4. What is the ATC function?

This function searches a string, like "thisform.pageframe1.page2.textbox" for the presence of a specified word ike "textbox". If "textbox" is found within the string, ATC returns the starting position within the searched string where "textbox" begins. The case statement in the setallprops method become true when ATC find the string, return its starting position. If ATC return 0, the string was not found and the case statement is false.

Many people develop their own classes from scratch, or use a copy of the wizstyle class as a starting place in designing thier own class. Also, many programmer like to create forms programmically on the fly. I love using the GUI tools of Visual FoxPro to design my forms. I think being able to program a form visually is the best thing since sliced bread. That is why its called Visual FoxPro.

LelandJ


Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Leland

The SetAllProps is a method in the basefore wizstyle class. It is called from the init event of the base class.

In all the versions of VFP I used, SetAllprops is a method found in the commandgroup (wizbtns) class, not the baseform class. And It is call from the "buttonrefresh()" method of the commandgroup and not the init. Unless you have a different version then...

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Sorry Mike,

I lost my place after getting into another project. Yes, it is called from the "txtbtns" navigation object in its init event, I believe. It is interest that it was place there, since it could have just as easily been placed in the init event of the basefrom. Maybe the authors of this class wrote it this way so it could be removed and replace with some other navigation object while still keeping all the other functionality of the wizstyle class.

LelandJ

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Hi Mike,

I read your post again and went back to the txtbtns navigation object and found this which is the init event:

***********************************************

#DEFINE C_WIZSTYLE "WIZSTYLE.VCX"
#DEFINE C_WIZDIR "WIZARDS\"
#DEFINE C_PROMPT1_LOC "Find: "
#DEFINE E_NOSTYLE_LOC "The class library (WIZSTYLE.VCX) needed by this form could not be found. "+;
"Please locate."

LOCAL cGridRef,cWizHomePath,separator,cWizStyFile


IF TYPE('THIS.Parent') # "O"
RETURN
ENDIF

IF SET("TALK") = "ON"
SET TALK OFF
THIS.oldTalk = "ON"
ELSE
THIS.oldTalk = "OFF"
ENDIF


IF ATC(C_WIZSTYLE,SET("CLASSLIB")) = 0

* Returns just the pathname
cWizHomePath = _WIZARD
IF '\' $ cWizHomePath
cWizHomePath = SUBSTR(m.cWizHomePath,1,RAT('\',m.cWizHomePath))
IF RIGHT(m.cWizHomePath,1) = '\' AND LEN(m.cWizHomePath) > 1 ;
AND SUBSTR(m.cWizHomePath,LEN(m.cWizHomePath)-1,1) <> ':'
cWizHomePath = SUBSTR(m.cWizHomePath,1,LEN(m.cWizHomePath)-1)
ENDIF
ELSE
cWizHomePath = ''
ENDIF

* Add a backslash unless there is one already there.
separator = IIF(_MAC,&quot;:&quot;,&quot;\&quot;)
IF !(RIGHT(m.cWizHomePath,1) $ '\:') AND !EMPTY(m.cWizHomePath)
m.cWizHomePath= m.cWizHomePath+ m.separator
ENDIF

DO CASE
CASE FILE(C_WIZSTYLE)
cWizFile = C_WIZSTYLE
CASE FILE(m.cWizHomePath+C_WIZSTYLE)
cWizFile = m.cWizHomePath+C_WIZSTYLE
CASE FILE(m.cWizHomePath+C_WIZDIR+C_WIZSTYLE)
cWizFile = m.cWizHomePath+C_WIZDIR+C_WIZSTYLE
CASE FILE(HOME()+C_WIZSTYLE)
cWizFile = HOME()+C_WIZSTYLE
CASE FILE(HOME()+C_WIZDIR+C_WIZSTYLE)
cWizFile = HOME()+C_WIZDIR+C_WIZSTYLE
OTHERWISE
=MESSAGEBOX(E_NOSTYLE_LOC)
cWizFile = GETFILE(&quot;VCX&quot;,C_PROMPT1_LOC+C_WIZSTYLE)
ENDCASE

IF ATC(C_WIZSTYLE,m.cWizFile)#0
SET CLASS TO (m.cWizFile) ADDITIVE
ELSE
* Failed to get WIZSTYLE.VCX file
RETURN .F.
ENDIF

ENDIF

THIS.InitVars()
THIS.ButtonRefresh()
THIS.NavRefresh()
cGridRef=THIS.GridRef
IF !EMPTY(m.cGridRef)
* Change this if you desire to have the grid initially selected.
* THISFORM.&cGridRef..SetFocus()
ENDIF

*****************************************************

Your right, the ButtonRefresh() is called which in turn calls setallprops.

LelandJ

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Hi,

I decided to go back and take a dose of my own advise by stepping through the setallprop method. I entered the relevant variables in the watch window, so I could see the result of the code as I step through it. The setallprop method is concerned with setting control on your form to readonly, or not, depending on the edit mode. Here is the code I entered in my baseform wisstyle class, and which all of my forms inherite, so they have a uniform look and feel based on the windows theme currently seletcted.

******************************************************

With This
.SetAll(&quot;BackColor&quot;,GetSysColor(13),&quot;HEADER&quot;)
Endwith

With This
.SetAll(&quot;ForeColor&quot;,GetSysColor(14),&quot;HEADER&quot;)
Endwith

With This
.SetAll(&quot;FontBold&quot;,.F.,&quot;HEADER&quot;)
Endwith

************** Enabled Objects ***********************

WITH thisform

*thisform.pageframe1.SetAll(&quot;BackColor&quot;, GetSysColor(13), &quot;Editbox&quot; )
.SetAll(&quot;BackColor&quot;, GetSysColor(13), &quot;Textbox&quot; )
.SetAll(&quot;BackColor&quot;, GetSysColor(13), &quot;Combobox&quot; )
.SetAll(&quot;BackColor&quot;, GetSysColor(13), &quot;Combo&quot; )
.SetAll(&quot;BackColor&quot;, GetSysColor(13), &quot;CheckBox&quot; )
.SetAll(&quot;BackColor&quot;, GetSysColor(13), &quot;OptionButton&quot; )

*thisform.pageframe1.SetAll(&quot;ForeColor&quot;, GetSysColor(14), &quot;Editbox&quot; )
.SetAll(&quot;ForeColor&quot;, GetSysColor(14), &quot;Textbox&quot; )
.SetAll(&quot;ForeColor&quot;, GetSysColor(14), &quot;Combobox&quot; )
.SetAll(&quot;ForeColor&quot;, GetSysColor(14), &quot;Combo&quot; )
.SetAll(&quot;ForeColor&quot;, GetSysColor(14), &quot;CheckBox&quot; )
.SetAll(&quot;ForeColor&quot;, GetSysColor(14), &quot;OptionButton&quot; )

***************** Selected Item ************************
.SetAll(&quot;SelectOnEntry&quot;, .T., &quot;Editbox&quot; )
.SetAll(&quot;SelectOnEntry&quot;, .T., &quot;Textbox&quot; )
.SetAll(&quot;SelectOnEntry&quot;, .T., &quot;Combobox&quot; )
.SetAll(&quot;SelectOnEntry&quot;, .T., &quot;Combo&quot; )
*thisform.SetAll(&quot;SelectOnEntry&quot;, .T., &quot;Checkbox&quot;)

* .SetAll(&quot;SelectedBackColor&quot;, RGB(255,255,128), &quot;Editbox&quot; )
* .SetAll(&quot;SelectedBackColor&quot;, RGB(255,255,128), &quot;Textbox&quot; )
* .SetAll(&quot;SelectedBackColor&quot;, RGB(255,255,128), &quot;Combobox&quot; )
* .SetAll(&quot;SelectedBackColor&quot;, RGB(255,255,128), &quot;Combo&quot; )
* *thisform.SetAll(&quot;SelectedBackColor&quot;, RGB(255,255,128), &quot;Checkbox&quot; )

.SetAll(&quot;SelectedBackColor&quot;, GetSysColor(14), &quot;Editbox&quot; )
.SetAll(&quot;SelectedBackColor&quot;, GetSysColor(14), &quot;Textbox&quot; )
.SetAll(&quot;SelectedBackColor&quot;, GetSysColor(14), &quot;Combobox&quot; )
.SetAll(&quot;SelectedBackColor&quot;, GetSysColor(14), &quot;Combo&quot; )
*thisform.SetAll(&quot;SelectedBackColor&quot;, RGB(255,255,128), &quot;Checkbox&quot; )

* .SetAll(&quot;SelectedForeColor&quot;, RGB(0,0,0), &quot;Editbox&quot; )
* .SetAll(&quot;SelectedForeColor&quot;, RGB(0,0,0), &quot;Textbox&quot; )
* .SetAll(&quot;SelectedForeColor&quot;, RGB(0,0,0), &quot;Combobox&quot; )
* .SetAll(&quot;SelectedForeColor&quot;, RGB(0,0,0), &quot;Combo&quot; )
* *thisform.SetAll(&quot;SelectedForeColor&quot;, RGB(0,0,0), &quot;Checkbox&quot; )

.SetAll(&quot;SelectedForeColor&quot;, GetSysColor(13), &quot;Editbox&quot; )
.SetAll(&quot;SelectedForeColor&quot;, GetSysColor(13), &quot;Textbox&quot; )
.SetAll(&quot;SelectedForeColor&quot;, GetSysColor(13), &quot;Combobox&quot; )
.SetAll(&quot;SelectedForeColor&quot;, GetSysColor(13), &quot;Combo&quot; )
*thisform.SetAll(&quot;SelectedForeColor&quot;, RGB(0,0,0), &quot;Checkbox&quot; )

**************** Disabaled Objects *************************
*.SetAll(&quot;DisabledBackColor&quot;, RGB(255, 255, 255), &quot;Editbox&quot; )
*.SetAll(&quot;DisabledForeColor&quot;, RGB( 0, 0, 0), &quot;Editbox&quot; )

.SetAll(&quot;DisabledBackColor&quot;, RGB(255, 255, 255), &quot;Textbox&quot; )
.SetAll(&quot;DisabledBackColor&quot;, RGB(255, 255, 255), &quot;Combobox&quot; )
.SetAll(&quot;DisabledBackColor&quot;, RGB(255, 255, 255), &quot;Checkbox&quot; )
.SetAll(&quot;DisabledBackColor&quot;, RGB(255, 255, 255), &quot;Optionbutton&quot; )

ENDWITH

***************************************************

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Leland123

I decided to go back and take a dose of my own advise by stepping through the setallprop method.

This is way beyond the call of duty, you deserve a star for the extra effort. We should only guide the member in the right direction, not write the whole thing for them ;-)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top