Spadix Software has a free screen ruler utility that makes it easy to measure the sizes of things on your screen: http://www.spadixbd.com/freetools/index.htm. This solves the problem of deciding a form needs to be bigger, resizing it at runtime, and then trying to figure out what the new size is. I usually brought up the Debugger and typed something like “_screen.activeform.width” into the Watch window, but this is a lot easier.
Tuesday, September 29, 2009
Thursday, September 24, 2009
I prefer to avoid horizontal scrollbars if possible. A horizontal scrollbar automatically appears in a ListView ActiveX control if the columns are sized too wide for the width of the ListView. I like to size the columns so they exactly fit within the width of the ListView. However, if the ListView’s Anchor property is set to resize the control when the user resizes the form, at some point a vertical scrollbar appears if the ListView is sized too short for the rows displayed. Since the scrollbar takes up some of the width of the ListView, a horizontal scrollbar also appears.
The trick is to detect when the vertical scrollbar appears and adjust the width of the columns so they fit within the remaining width. The following code, which goes in the Resize event of the form or container the ListView is in, handles that. This code assumes there’s only two columns and the second column should be resized. Adjust the code as necessary to use different columns
* See if the ListView has a vertical scrollbar.
#define WS_HSCROLL 0x100000
#define WS_VSCROLL 0x200000
#define GWL_STYLE -16
declare integer GetWindowLong in Win32API integer hwnd, integer nIndex
llScroll = bitand(GetWindowLong(.hWnd, GWL_STYLE), WS_VSCROLL) <> 0
* Set the width of the second column.
lnWidth = .Width - .ColumnHeaders.Item(1).Width - sysmetric(4) - ;
iif(llScroll, sysmetric(7), 0) + 4
&& 4 is a fudge factor for width
.ColumnHeaders.Item(2).Width = max(lnWidth, 0)
Tuesday, September 22, 2009
Just fill in this quick 10 minute survey about .NET tools and you could win one of five $100 vouchers to spend with Amazon. Take the survey here: http://www.questionpro.com/akira/TakeSurvey?id=1325041
Thursday, September 10, 2009
Due to the condition of the global economy, we're seeing a drop in registrations for Southwest Fox 2009 this year. So we have a couple of special "recession buster" deals we hope will encourage a few more people to sign up for the best Visual FoxPro conference in North America.
Deal #1: "Organizers: please share my deal!"
If you already registered and paid for the conference and you know someone who wants to register, you can give them the same deal you got when you registered. If you want to come to the conference and you know someone who got in at the Super Saver ($620) or the Early-bird ($695) registration, you can sign up for the same price they did. Sharing is caring!
Deal #2: Southwest Fox "Pair Programmer" deal
Have one or more FoxPro friends who are considering coming to Southwest Fox? Sign up together and take $50 off each of the registrations.
No matter what deal you take, we will give you your first pre-conference session for free!
There's only one catch. You have to take advantage of this deal by 11:59 PM September 30, 2009 Eastern time. We have to make some serious commitments on October 1 for various expenses we have for the conference. See the Registration page for more details.
Friday, September 04, 2009
For the first time, this year’s edition of Southwest Fox will have a real keynote speaker. Sara Ford, Program Manager for CodePlex at Microsoft, is doing a presentation called “Towards a Stronger Open Source Ecosystem on CodePlex.com.” As you likely know, VFPX, the premier VFP community site, is hosted on CodePlex. For more details, see the Southwest Fox Blog.
I’ve met Sara several times and let me tell you, she is a character. She’s also very interested in VFPX. She gave us several tips early on about how to better organize VFPX (VFPX is unusual for CodePlex in that it’s a collection of many projects rather than just a single one) and even made a tweak to CodePlex to help VFPX work better.
Between the line-up of speakers, top-notch sessions, great networking opportunities, a chance to talk face-to-face with exhibitors about their products, and now having Sara deliver the keynote, Southwest Fox 2009 is shaping up to be even better than last year. See you next month in Arizona!