Get space between a checkbox and text in a CButton with BS_AUTOCHECKBOX

Hi,

I have created a CButton with BS_AUTOCHECKBOX style and I would like to 
be able to resize my control to fit the text.
So I know how to calculate the text width but how can I know the space 
taken by the checkbox + the space bewteen the checkbox and my text ?
0
7/9/2007 9:37:16 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
685 Views

Similar Articles

[PageSpeed] 25

THe way I solved this was to create, on my dialog, a button which had no characters in it,
just the space.  This was a hidden, disabled control.  Then I used this to get both the
height and the width I needed for the basic button and added to the width the
GetTextExtent value.

This is the safest way to create buttons, because you cannot hardwire the height into your
program; you have to create them at the same height as a button would be in the current
resolution with the current default font using the current display driver for your current
display card on your current display.
					joe

On Mon, 09 Jul 2007 11:37:16 +0200, mosfet <john.doe@anonymous.org> wrote:

>Hi,
>
>I have created a CButton with BS_AUTOCHECKBOX style and I would like to 
>be able to resize my control to fit the text.
>So I know how to calculate the text width but how can I know the space 
>taken by the checkbox + the space bewteen the checkbox and my text ?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
7/9/2007 12:51:32 PM
Reply:

Similar Artilces:

Can't get a value from a querry into a forms text box
I have a main Shippin Control table, and a main Shipping Control form with description of cargo and quantity text boxes. I have a querry which is a join of tblValues and tblShipping_Control. The SQL is below SELECT Shipping_Control.DescriptionofCargo, Shipping_Control.CargoQty, tblValues.Value, ([Shipping_Control].[CargoQty]*[tblValues].[Value]) AS CommercialValue, Shipping_Control.ShippingDate, Shipping_Control.ShipTo, Shipping_Control.ShipFrom, Shipping_Control.CollectionNoteNo, Shipping_Control.PackingListNo, Shipping_Control.ShipmentID, Shipping_Control.Customer FROM Ship...

How to setup buy 10 get one free
Is there a module that can set rules for the sale of free goods? Suppose a retailer wants to do a special promotion. He wants to give away 1 unit free if a customer buys 10 units of an item. I just had another look at the Extended Pricing module. The documentation suggests that it should be able to do this. Now all I need is the bundled pricing. "jamrock" <news_jamrock@yahoo.com> wrote in message news:eLC9acO9FHA.1032@TK2MSFTNGP11.phx.gbl... > Is there a module that can set rules for the sale of free goods? > > Suppose a retailer wants to do a special promoti...

Get drive problem
Hello. I am having problem with the getdrive in vba. When I insert a Usb Flash drive it works. When I pull out the flash drive it debugs to the getdrive line in vba. It even debugs and ignors the on error goto err_Error_Click. Trapping the error doesn't work for me. Dim fsH, dH Set dH = fsH.GetDrive("G:") If dH.IsReady Then run my code here End If Is there anyway to solve this problem? Don't know what else to do. Are you sure you're not using vbscript? On Error Resume Next is the only Error trapping available there AFAIK. I hope you init fsH in a way (Early...

Checking text length.
I have a large list of names (about 2500) in microsoft excel but I need to find all cells within a column that have a text length of more than 30 characters including spaces. Is there an easy way to do this or do I need to start counting? Thanks. Chris. Hi one way: - select your data (e.g. cells A1:A3000) - goto 'format - Conditional Format) - enter the following formula =LEN(A1)>30 - choose a format to highlight these cells >-----Original Message----- >I have a large list of names (about 2500) in microsoft excel but I need to >find all cells within a column that have a te...

Rookie-building DB-want to get right the first time! Help?
Rookie user: Access 2007, Using “Picture Yourself Learning: Microsoft Access 2007” as reference guide. Need suggestions for how to structure what seems to me to be a very complicated DB. I want to build it the best way the first time, so I don’t do a lot of work and not have it do what I need. Here’s what I need to do: Track GIS datasets for about 50 natural and environmental hazards. The data itself does not need to be tracked. I do need to track its source (National, State, County or City data) and know its date of creation, and frequency of updates for example. I don’t k...

How get blank document as default
Every time I ask to open a new doc it goes to one of my own password protected ones. How do I just get a bloody blank document to be default???? See http://word.mvps.org/FAQs/AppErrors/BlankDocNotBlank.htm. -- Stefan Blom Microsoft Word MVP "Frustrated as all get out" <Frustrated as all get out@discussions.microsoft.com> wrote in message news:813F000F-A09E-435C-ADF6-17B8202876E1@microsoft.com... > Every time I ask to open a new doc it goes to one of my own password > protected ones. How do I just get a bloody blank document to be > default????...

Text To Date Conversion
Hi I run Excel 2000 I download information from a mainframe into Excel. In cell F5 the data looks like this: 19.11.2007 This is formatted as text and is left aligned. When I try to reformat it to a date (19/11/2007) it does not change. I would like to have a formula in cell N5 that changes the original data to a datevalue. (eg: 19/11/2007) Thanks If column F contains a lot of the "date" values, then you could: Data|Text to columns Fixed width (but don't have any separator lines!) choose Date (dmy order) and finish up Then give the range the date ...

text not wrapping in column
I have an Excel spread sheet with columns of wrapped text. At a certain point, the text stops wrapping. If I try to shrink to fit, the text disappears. Any ideas? ...

Text Form Field Maximum Character Length
I want to have a text form field that has a maximum character limit of 300 characters. I go into properties and set the max length to 300 and select calculate on exit, but it doesn't stop entries over the 300 characters. Any suggestions? It is Word 2003. -- Thanks, Angie ...

Formula to get the current weeknumber
Hi I am trying to get the weeknumber (1 to 52) out of the date. Read somewhere that excel has a WeekNo function but I cant find it. Perhaps I got to old version of excel (ver 2000 9.0.4402 SR-1). Date Weekday Week YearWeek A B C D 1 2005-09-10 Saturday 36 0536 2 2005-12-24 Saturday 51 0551 3 2006-02-07 Tuesday 06 0606 4 5 6 7 As of now I have a ownwritten formula but it doesnt handle years containing 53 weeks correctly. How can I get the weeknumber out of the date? /S Th...

Automate text import
Hi, I've wrtten a batch file to audit all our servers, what I'd now like to do though is come up with a way excel can load these text files into one worksheet. Can anyone please help? Below is an example of the data gathered - the text files are named after the computer. Thanks Ben Computername: TEST Kernel version: Microsoft Windows 2000, Uniprocessor Free Product type: Professional Service pack: 3 IE version: 5.0100 System root: C:\WINNT Processors: 1 Processor speed...

Trouble forwarding email as text message using SMS
I have set up to forward specific emails to my cell phone as text messages. The content of the message does not come thru as part of the text (these messages are SHORT messages) Any suggestions? -- Sheri Sheri <Sheri@discussions.microsoft.com> wrote: > I have set up to forward specific emails to my cell phone as text > messages. The content of the message does not come thru as part of > the text (these messages are SHORT messages) > Any suggestions? No need to ask more than once. -- Brian Tillman [MVP-Outlook] ...

How to get the info from form to query to report
I have a form that uses 5 tables for the information so I built a query to have the info all in one place. I also want to use the submit button to send the information to a report to be emailed, right now the report comes in blank. Please help I am fairly new to access and trying to build this for work. Base you report on a query. Use the form reference as criteria in the query like this --- [Forms]![YourFormName]![YourObject] [YourObject] is displaying the data from the 5 tables. -- KARL DEWEY Build a little - Test a little "sandyL" wrote: > I have a form that us...

How do I add a floating text box in Excel?
I have a shared workbook with several huge spreadsheets. There are certain things that other users/viewers would readily want to know without parsing to the end of the spreadsheet. How can I create a floating text box in Excel and include totals of certain cells from the same worksheet? MS has lots of templates at: http://officeupdate.microsoft.com/TemplateGallery And there's always google! Prashant wrote: > > I have a shared workbook with several huge spreadsheets. There are certain > things that other users/viewers would readily want to know without parsing to > the...

How to get Bills and Budget to synch?
I have Money '07 and I'm using it to try to set up a budget. Problem is, it's a little cumbersome to have to go in and retype each category and amount for things such as rent, gas, cell phone charges, etc. when all of that information is currently in the Bills section. Is there a way to get the budget to grab all of those non-variable values and use them so the only thing I have to manually budget is what's left over? Also, it doesn't seem like the cash flow forecaster (not sure if that's what it's called) is considering my budget items - only the items und...

Allow multiple selections within a checkbox of items
How do I create the option within a form to select more than one option within a field? Shawna, Use checkboxes rather than option buttons. Option buttons are limited to one selection per frame - checkboxes are not. HTH, Bernie MS Excel MVP "shawna" <shawna@discussions.microsoft.com> wrote in message news:C447FF94-8454-4DC1-ADC2-3E0DDD7EFD61@microsoft.com... > How do I create the option within a form to select more than one option > within a field? ...

Where does SmartList get QTY Shipped from?
According to the SDK documentation, the Purchase Line Items standard SmartList gets its data from the POP10110/POP30110 PO Line tables (plus some other master tables). My question is, how does the SmartList come up with the QTY Shipped value for a PO line? As far as I can tell, there's no field in these tables for the shipped quantity. Any ideas? -- Bud Cool, Accounting System Manager HDA, Inc. Hazelwood, MO GP 9.0, SP2 Bud, there's a QTYSHHPD field in POP10500. That may be what you're looking for. Frank Hamelly MCP-GP, MCT East Coast Dynamics www.eastcoast-dynamics.com ...

Preventing certail domains from using * Address Space?
Due to an integration we need to ensure that ALL SMTP traffic to certain domains stays on our internal network tunnels and is delivered to a specific IP address in a separate Exchange Org. The problem is that even with a separate SMTP Connector with a cost of 1 we are still seeing some mail flow to our other higher cost connectors. How can this be prevented? Thank you for your help, Paul <pfortner@gmail.com> wrote in message news:1127494597.758768.269880@g14g2000cwa.googlegroups.com... > Due to an integration we need to ensure that ALL SMTP traffic to > certain domains stays ...

Scatter with text on X
I am trying to construct one scatterplot for 2 groups of data A & B. would like to have A and B as two points on the X-axis and the (Y data values which pertain to A and B plotted as dots above them in vertical line. I have tried many different things and HELP to try to do this an no-one at work knows either. I am obviously missing out on somethin simple but important. Expert experience would be greatly appreciated! Donal ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.c...

Seperating text, backwards to frontwards #2
Hi All, I have a field which is like the below example: "Disappointed at failure - 68 Interior equipment - Repair group: Body - ..Archive" Now I want to split this into fields, as per below: A B C D ..Archive Repair group: Body 68 Interior equipment Dissapointed at failure I know that I can use text to columns to split the field by the "-" but then how do I get it reversed? NOT all of the fields can be split into 4, sometimes there can be up to 7 or as little as 1. Does anyone have an answer? Regards Adam use ...

Non-Breaking Space + Print Issue
I have two questions for the group. 1) I'm having the same problem as others with getting the Y axis labels to print completely. It appears that the last character of the axis label is cut in half. I've seen someone post the code for a non-breaking space, but I can't find it. 2) I have some bubble charts that I'm trying to print. When I print them directly from excel, they print as squares with inscribed circles. The same happens when I print from Word and the chart is copies as a picture file from Excel to Word. Once the Word document is PDF'd, the bubble cha...

how do i get a template in MS access for managing employees & payr
Dear friends, i intend to design a simple database that can help my organisation manage its employees {departments, addresses, telephone nos, payments(both basic and extras), deductions from salaries, payment types(weekly, monthly, fortnights), contracts (types, terms and duration) and generate monthly details for each employee. Dear Isaac, You don't yet realise that what you have described is not a "simple database". Read widely, on how a relational database works. Here's a site where you can find lots of essential basic material: http://www.accessmvp.c...

Some poor slob installed Ubuntu. Needs to run line commands to get that piece of crap to work
I installed ubuntu 9.10 and it was rebooting just before the login screen. After really long search it turned out it's the video driver, I guess the one coming with ubuntu didn't like my card. I have integrated Radeon HD3200. What worked for me: 1. Select recovery mode from grub menu (in your case for 9.10 too) 2. In the first following screen select "root with networking" to have internet 3. Install video driver package EnvyNG with: sudo apt-get install envyng-core envyng-qt <==================== line commands to get sucky Ubuntu to work. Oops. 4. Run i...

Read Text File into Excel Using VBA
Hi All, I'm a new VBA programmer. I know how to pull an entire text file into an Excel Spreadsheet, but I only want specific information from the text file not the entire text file. What I have is about 25 text files stored in a folder, let's say C:\test. Each file is named by a property address as follows: 209 MAIN ST.txt 213 MAIN ST.txt 111 ELM ST.txt 2356 WOOD AVE.txt On the 11th row of each file is as follows: Property Address:209 MAIN ST On the 31st row of each file is as follows: Total Value:30500 What I would like to do is read each file located in the "C:\test folder...

Help
Hi, I have Money Home & Business 2008. The service contract is still valid for online updates. When I do an update, only some of my investments are getting updated. The others have not gotten updated for over 3 weeks now. When I look at the individual investments on their company websites (ie: Mutual funds CA:HKB504 and CA:HKB517) I can tell the price has changed. Any idea why Money stopped updating some of my investments? In microsoft.public.money, apkesh wrote: >Hi, >I have Money Home & Business 2008. The service contract is still valid for >online updates. Wh...