Hidden Secrets of the VFP IDE, Part 1

 

Hidden Secrets of the VFP IDE, Part 1

Cathy Pountney

FoxPro has always had several different ways to do the same thing. How many times have you looked over the shoulder of another developer and said, "Hey! How did you do that?" In this series of articles, Cathy Pountney will uncover many ways to work within the IDE, especially those that aren't so obvious or aren't documented. You'll learn several different ways to improve your productivity. Even experienced developers are bound to learn something new.

In Part 1 of this two-part series, I'll uncover many hidden secrets in several areas of Visual FoxPro. I'll discuss various designers, a few controls, the Property Sheet, the Document View, the Find dialog, IntelliSense, and several tools and utilities included with Visual FoxPro. In Part 2 of this series I'll reveal secrets of the Command window and several commands, and wrap up with a potpourri of hidden secrets.

Report Designer

Of course you knew I was going to start with my favorite designer, the Report Designer!

Navigate between objects
In VFP 8, you can navigate between controls on a report simply by using Tab to go to the next control and Shift+Tab to go to the previous control. In versions prior to VFP 8, you have to use Ctrl+Tab to first get into tab mode, and then you can tab through objects with Tab and Ctrl+Tab.

Edit an existing label
To edit the text of an existing label object on a report, simply select the object and then press Ctrl+E. This puts you into an edit mode so that you can change the text on the label.

Forms Designer
VFP has some tricks for working with containers.

Drilling into containers
Working with container objects, such as a pageframe, can be difficult sometimes. However, you can quickly edit an object inside of a container by using Ctrl+Click over the object. This passes through the container and lets you edit the control inside of the container.

When you have containers nested within containers, you can use Ctrl+Shift+Click to drill to the deepest level. For example, if you have an optiongroup on a page of a pageframe, you can position your cursor over one of the optionbuttons, press Ctrl+Shift+Click, and VFP drills through the pageframe, and through the page, and through the optiongroup, and right into the optionbutton.

Listbox and combobox controls

The "/" character has special meanings when used in listboxes and comboboxes—see Table 1 for details.

Table 1. Using the "/" character in listboxes and comboboxes.

Char

Description

/

If the "/" is used as the first character, the entire item is disabled.

//

Because a single backslash has special meanings, if you truly want a "/" in the item, you must use two backslashes together.

/]

Because a single backslash at the beginning of an item means that it should be disabled, if you truly have an item that starts with a backslash, you have to use "/]" to indicate that this should not be disabled.

/-

A backslash followed by a dash means that you want a horizontal line drawn for this item.

Grid controls

Grids have always been somewhat difficult to work with, especially for new developers, because some things just aren't intuitive.

Adding controls
As columns are added to a grid, you automatically get two controls—a header control called Header1 and a textbox called Text1. However, in many cases you need something other than a textbox. Unfortunately, it's not easy to figure out how to add and delete controls inside of columns.

The first thing you have to do is drill into the grid. Place your mouse over one of the rows of the column you want to change and press Ctrl+Click. Be sure you're on one of the data rows of the grid and not the header row. You now have the column active and you can use the Form Control toolbar to drag and drop the object you want into the column.

When you drop the object on the column, it doesn't look like anything happened. However, if you look at the Property Sheet and drill into the column, you'll see that the original Text1 textbox is there as well as the object you just added. The CurrentControl property of the column is still set to Text1, which is why you don't see your object.

If you were to change the CurrentControl property of the column to the name of the object you just added, the grid would show your object. However, if you don't really need the original Text1 textbox, you might as well get rid of it and not worry about having to set the CurrentControl property.

Deleting controls
If you thought adding a control wasn't very intuitive, I'm sure you're going to roll your eyes when you learn how to delete an unwanted control. It's about as unintuitive as it can get. First, select the control you want to delete in the Property Sheet. Next, use your mouse to click on a data row in the grid and then press the Delete key to delete the control. Even though nothing may have appeared visually in the grid, if you look at the Property Sheet, the object will be gone now.

Navigation
Grids present another interesting problem to end users. Users are trained that Tab takes them to the next control. However, when inside a grid, Tab moves between columns in the grid. So how does a user get out of the grid? The answer is to use Ctrl+Tab to navigate to the control after the grid or use Ctrl+Shift+Tab to navigate to the control before the grid.

The Property Sheet

There are several different keyboard shortcuts for invoking, navigating, and setting values in the Property Sheet (see Table 2).

Table 2. Keyboard shortcuts for invoking, navigating, and setting values in the Property Sheet.

Keyboard shortcut

Description

Alt+DoubleClick

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值