Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



SSWUG


XAMALOT
 


Sharepoint TechCon

Reader rating:
Click here to read 8 comments about this article.
Article source: CoDe (2004 - Vol. 2 - Issue 1 - Visual FoxPro 9.0)


Article Pages:  1  2 3 4 - Next >


Controls, Events, Commands, and More

Microsoft Visual FoxPro 9 is here and it brings lots of new features.This entire issue of CoDe is dedicated to Visual FoxPro 9, providing details and scenarios on how you can use the new features and enhancements. In this article, I will discuss some of the new controls, events, and commands, and a little more.

"
The AppStates property indicates whether the application has focus (value 1), or not (value 0).
"

I'm sure you are as anxious as I am to explore new properties, events, and methods, new or improved commands, and FoxPro Foundation Classes (FFCs). Let's dive right in!

Anchoring Controls

Before Visual FoxPro 8, many lines of code had to be written in order to properly resize onscreen controls whenever a form was resized. In Visual FoxPro 8, that task got slightly easier with the introduction of the BindEvent function. In Visual FoxPro 9, it gets way easier with the introduction of anchoring. Anchors allow a control to maintain its proportional relationship with other objects and controls within a form, no matter what size the form becomes.

The Anchor property is obeyed when the control sits on containers such as Forms, CommandGroups, and Page objects. Whenever those containers get resized, the controls within it that have the Anchor property set are resized and/or repositioned depending on the settings used. Make sure to check out the Anchor Property topic on the Help file for available settings.

Docking Forms

Docking allows toolbars and other controls to be "attached" to any user-chosen edge of a Form and maintain that positioning despite resizing or scrolling. Visual FoxPro 8 introduced the ability to dock objects, such as the Command, Document View, and Properties windows, as well commands and functions that handled docking programmatically.

Visual FoxPro 9 goes a step further and introduces the docking capability to user-defined forms as well. That enables creating dockable Forms on the IDE or on the application delivered to the users.

In order to support this feature, new members were added to the Form class, such as the Dockable and Docked properties, the Dock and GetDockState methods, and the AfterDock, BeforeDock, and UnDock events. Listing 1 shows a simple example that produces the result showed on Figure 1.

Click for a larger version of this image.

Figure 1: Docking user-defined windows is simple.

Collection Object Support in ComboBox and ListBox Controls

The RowSourceType property on ComboBox and ListBox objects has a new option added to the list of possible sources: value 10, for the Collection object.

A Collection could be populated with Business objects or objects holding some sort of data, and that Collection can be used to populate ComboBoxes and ListBoxes. The following code snippet shows an example of that, using a collection named colEmployees contained in the form, and the ComboBox's RowSourceType property is set to 10.

Select EmployeeId, FirstName;
  from employees into cursor curTemp

  Scan 
   Local loEmployee as Object
   Scatter NAME loEmployee Blank
   Scatter NAME loEmployee additive

   This.colEmployees.Add(loEmployee,;    
          Transform(loEmployee.EmployeeId))
  EndScan 

  This.cboEmployees.RowSource =;
    "Thisform.colEmployees, FirstName, EmployeeId"
&

By: Claudio Lassala

Claudio Lassala is a Senior Developer at EPS Software Corp. He has presented several lectures at Microsoft events such as PDC and various other Microsoft seminars, as well as several conferences and user groups across North America and Brazil. He is a multiple winner of the Microsoft MVP Award and also holds the MCSD for .NET certification.

He has articles published on several magazines, such as MSDN Brazil Magazine, CoDe Magazine, UTMag, Developers Magazine, and FoxPro Advisor.

Blog: http://claudiolassala.spaces.live.com

classala@eps-software.com

Fast Facts

As is common with every new version of Visual FoxPro, new commands, properties, methods, and events are introduced. This article highlights some of these new features to make the introductions, but you'll want to look at the "What's New" section on the Help file, because there's a lot more in there.



Listing 1: Docking User-Defined Windows
Local loMainForm as Form
Local loCustomerForm1 as Form
Local loCustomerForm2 as Form
Local loCustomerForm3 as Form

loMainForm = CreateObject("MainForm")
loCustomerForm1 = CreateObject("CustomerForm")
loCustomerForm2 = CreateObject("CustomerForm")
loCustomerForm3 = CreateObject("CustomerForm")

loCustomerForm1.Caption = "Customer 1"  
loCustomerForm2.Caption = "Customer 2"  
loCustomerForm3.Caption = "Customer 3"  

loCustomerForm1.Dock(3, loMainForm)
loCustomerForm2.Dock(2, loCustomerForm1)
loCustomerForm3.Dock(2, loCustomerForm2)

loMainForm.Show()

Read Events

Define CLASS CustomerForm as Form

   *-- The value of one indicates this form
   *-- "Supports dock and is dockable"
   Dockable = 1 

EndDefine  

Define CLASS MainForm as Form

   Dockable = 1 

   Procedure Destroy()
      Clear Events 
   EndProc 

EndDefine  


Article Pages:  1  2 3 4 - Next Page: 'Rotating Label, Line, and Shape Controls' >>

Page 1: Controls, Events, Commands, and More
Page 2: Rotating Label, Line, and Shape Controls
Page 3: TTOC() Converts DateTime Expressions to XML DateTime Format
Page 4: Retrieving Active SQL Connection Statement Handles

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
3.5 out of 5

47 people have rated this article.

Instantly Search Terabytes Of Text
“Lightning Fast”
– Redmond Mag
“Covers all data
sources” – eWeek
25+ fielded & full-text search options
dtSearch’s own document filters highlight hits in popular file types
Web Spider supports static & dynamic data
APIs for .NET, Java, C++, SQL, etc.
Win / Linux (64-bit & 32-bit)
www.dtSearch.com
 

      Sharepoint TechCon

 

CODE Training