Close button on tabs

I have a tab control with icons + labels. I want to include a little
'x' on the top-right corner of each tab (a close button).

I suspect I'm going to need to create a custom control. My question
is: Is is possible to subclass or somehow utilize CTabCtrl so that I
don't have to recreate the entire control form a CWnd or CStatic
control? If so, how?

Thank you all.
0
the44secs (141)
9/8/2008 4:20:29 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1122 Views

Similar Articles

[PageSpeed] 3

You can owner-draw the CTabCtrl. Here is a sample.

http://www.codeguru.com/Cpp/controls/controls/tabcontrols/article.php/c2237


You could draw the "X" in the DrawItem() code.

-SM
0
smisro (101)
9/8/2008 5:56:15 PM
On Sep 9, 2:56=A0am, Seetharam <smi...@gmail.com> wrote:
> You can owner-draw the CTabCtrl. Here is a sample.
>
> http://www.codeguru.com/Cpp/controls/controls/tabcontrols/article.php...
>
> You could draw the "X" in the DrawItem() code.
>
> -SM

Thank you, my friend.
0
the44secs (141)
9/9/2008 4:15:55 AM
Reply:

Similar Artilces:

ThisWorkbook.Close question
Please take a look at the code below: Public Sub DumbFoo ( ) ThisWorkbook.Close() Sheet1.Range("A1").Value = -1 ThisWorkbook.Save() End Sub Is it safe to assume that the code below the "ThisWorkbook.Close()" line will NOT be executed??? My question is basically: Does all VBA code stop executing once a .Close() function is called??? Thank you! I don't believe the code would execute at all because of the parentheses after Close. It would throw an error an tell you that something is missing, or type mismatch. But, if you did...

CPropertySheet wizard help button
I'm having trouble persuading a CPropertySheet not to display its help button when it's a modal wizard. The MSDN says just unset the PSH_HASHELP flags in the header before calling DoModal but this doesn't seem to work (perhaps only works for modeless). I can just get a handle to the help button window and hide it but the other buttons don't move to fill the gap so it looks odd. Anyone know how to made the Help button disappear for a modal CPropertySheet wizard? Cheers, K Hi, After you have a CPropertySheet object, use the following: CMyProPertySheet sheet; sheet.m_psh.dwF...

How to Enable Close(cross) button of MB_YESNO messagebox
Hi, I want to enable the close(cross) button in the right corner of YESNO message box. Can anybody tell me how to do this. Klic. "Klic" <rohit.turambekar@gmail.com> wrote in message news:1186120969.045121.287770@i13g2000prf.googlegroups.com... > I want to enable the close(cross) button in the right corner of YESNO > message box. > Can anybody tell me how to do this. Why? If there is a valid answer other than yes or no, then how about a yes/no/cancel message box in which (I would guess) the x button is equivalent to cancel. That would be more standard. Da...

Can't find the Exit Full Screen .. "Pop up button"
Hi all, I have got an unsual question as while I select View Full Screen to view my Excel sheet on screen.. I close the "Exit Full Screen" button as I want to be able to view the entire sheet. But now, I want to restore back the setting which to show "Exit Full Screen" button but I don't seem to be able to locate this option.. Appreciate any suggestion ... am using Excel 2003 (11.8220.8221) SP3 Thanks ! Can you still see the "File|edit|..." toolbar? If you can, then click: Tools|Customize|toolbars tab|check Full Screen. Keith wrote: > > Hi...

closing
What's the best way to close for the day? Making a backup is a given, but what about the computer? Is it better to shut everything off every day, or is it less wear and tear on the computer to leave it on all the time? Any thoughts on this would be appreciated. Craig That's a matter of preference really. Personally I always turn off my rigs at home when I'm done with them. At the store we leave most of ours on 24/7. We've done it for years with no issues. Our register must be left on as it does automatic backups to a tape drive every night. I'd set your monitors ...

Outlook closes and closes
Hi I have a strange bug. Windows XP Sp2 and outlook from office 20003 with all service packs applied. When I start outlook from windows out of standby postion, outlook immediately after the splash screen closes without reporting any errors in the eventlog or in any other log. If I start outlook the 10th time (or so) it stabilizes and does not close anymore and everything works again. info: My machine is fully patched and I am well known with keeping things healthy. Outlook.exe Version: 11.0.6353.0 Any ideas what to do? Thanks... try the detect and repair in the help menu. >----...

Windows XP Start button right click question.
When I right click on the start button in XP classic menu there are all kinds of things in the "context menu" such as Open, Explore, Explore from here, Scan with AVG, Combine files in Acrobat, Open in Onenote, Groove Folder syn---, Etc. Question is where and how do I delete these some of these things I never use? I looked in some of the different progs to no avail. Is it in the registery someplace? Thanks for the possible help. kraut wrote: > When I right click on the start button in XP classic menu there are > all kinds of things in the "context m...

Disappearing toolbar buttons
I tried to customize my toolbars, but some of the buttons dissappear. Example: I added the button for "Horizontal in Vertical" text formatting. (This command seems not to be available from the format menu.) I appears on the toolbar until I close customization, then it dissappears. When I open Visio it's there, but as soon as I click "new drawing" or open an existing drawing, it dissappears again. What's up?? -- Barry Milliken Some text-related buttons are only available in certain locales. Try going to Tools > Options > Regional and set the optio...

Custom Buttons
I use a lot of subscripts and superscripts in my work and I would like to create a custom button for a toolbar that automatically changes to subscripts and/or superscripts. Does anyone if you can create custom buttons? This looks like a tough one. It's easy to do for an entire cell, but I'm guessing you only sub- and super-script one (or some) of the characters in a cell, rather than a whole cell. The problem is that if you select characters in a cell, you cannot then run a macro on them; those options are unavailable on the menu (as are most buttons on the toolbars). If you want to...

Auto-close Quotes when Closing Opportunity
We would like the ability to close an opportunity and have it ask if you want to close all the associated quotes. Right now, it says you can’t close the opp until you close all the open quotes and you have to each one of those one by one. Barring that, if we could select multiple quotes and click on a menu item (Close all selected quotes), that would be most useful. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not ...

Workflow Rule -> Closing Activity
I set up a Manual Workflow Rule for Contacts to close out Holiday Season cards sent. The rule uses a condition to check for Contacts with cards sent and then Creates an Activity to add to each of the appropriate Contacts for future reference. What else do I need to do to close out all of activites rather than 1 at a time? Here is the workflow rule if that helps: if Contact.holidaycardlist = 1 then Letter: Send Holiday Card endif -- Dan W Systems Engineer Denver, CO ...

Help
When creating or fowarding an e-mail message using outlook 2000, scrolling through my "recipients" list (contacts) causes the program to close unexpectedly. So, I click "new", click "to", switch to my "contacts" list, and as I scroll through the names, the program just closes. Is there a possibility that one of my contact records is corrupt? I have opened all of my contacts and saved them without an error. This problem developed shortly after the install of Office 2000's calender update, and basic security update. I have since fully u...

Buttons in Excel?
Is it possible in Excel to create a button? I am creating a time sheet application - time worked for a week. Instead of entering the starting date (day, month, year) for the next week, I want just to click a button, and Excel will automatically add 7 days to the starting date. Is it possible? Thanks, Zalek It's certainly possible. Here's one way: Choose View/Toolbars/Forms to show the Forms toolbar. Click the Button control and drag in the worksheet to create a button. In the Assign Macro dialog that opens, click New. Enter this macro in the macro module that opens: Sub B...

Edit a worksheet command button
Using 2003 - I have inherited a workbook that has various command buttons on the worksheets. The buttons are attached to a macro. I need to edit the buttons but I can't seem to get the button into the edit mode. How do I do that? Glen If they're commandbuttons from the Control toolbox toolbar, then show that toolbar: View|Toolbars|Control Toolbox Then click on the Design mode icon. Do the work and click on that design mode icon once more to get back to normal. "glen.e.mettler@lmco.com" wrote: > > Using 2003 - I have inherited a workbook that has various comma...

Merge and Center button #2
On the formatting toolbar my Merge and Center button is grayed out. Not sure why. My spreadsheet contains text, and formulas. Is there something I did to make this button unavailable? Thanks, Tricia Gall Well, I figured this out. I had my workbook shared. Once I turned off sharing, the merge and center button was available. "gall" wrote: > On the formatting toolbar my Merge and Center button is grayed out. Not sure > why. My spreadsheet contains text, and formulas. Is there something I did > to make this button unavailable? > > Thanks, > Tricia Ga...

Data file not closed properly #3
I saw several post regarding this, but none had any answers, so I starting a new post. There is also nothing in the KB about this. Since othe people are having the same problem Microsoft should take a look at it. I get the message "The data file 'Personal Folders" was not closed properly" every time I close Outlook 2003. It runs a quick check/fix and starts up fine. I am running XP pro w/ SP-2. Outlook 2003 w/ SP-1 All patches and updates are current. My notebook was just rebuilt for so I could get a clean slate for the office 2003 install, (reformat drive and new ins...

Special indication color buttons
I need to use some color indication buttons inside my dialog box (not found in the vistual studio editor). Their shape should be circular and I want to change their color. Can someone refer to some sample code? Thanks in advance Vinter HI there! For making Custom Shape Button you have to Use SetWindowRgn Api. and for changing the Color of Button you have to Handle WM_CTLCOLORBTN in Win32 Based Project or WM_CTLCOLOR in MFC Based Project and return the valid Brush both for drawing. Search google for more Custom Button Wrapper ->button site:codeproject.com -- With Regards Alok...

Outlook2003 open and closed immediatly
I checked event log, nothing. And this happened when I just reboot my machine and first time tried to open Outlook, still same problem. But I found, when I double click anywhere in the Outlook Windows even it only gave me 0.5 second, then it won't close. Andy -------------------------------------------------------------- >>Look in task manager - processes, and see if multiple >>instances are running. If so, end all of them and try >>starting again. I had similar problem w/user, posted >>above. >>>>>-----Original Message----- >>>>>My O...

Determining Display Area of Tab Control in MFC
Can anyone help me understand the behavior of the following code? This code is part of an MFC application and CDialogTabCtrl is a class derived from CTabCtrl. m_arPanels is an array of pointers to CWnd objects that correspond to each tab of the tab control. The following code seems to work fine but I'm not sure why. The problem is the call to MoveWindow. The docs say that the right and bottom members of the structure specify the width and height of the window. But when I uncomment the two lines that convert the right/bottom to the width/height, I get a larger margin along the right and b...

Tab Control Shocker!
I’ve created a table with an associated form which has fields added to it almost on a daily basis as users see the advantages and would like to add there own pertinent fields. This means that the form is becoming crowded and needs re-jigging a bit. I thought that it might be a good idea to insert a tab control box and break my one page into a number of pages. However, I find that I can’t simply drag and drop my current form fields on to this tab control because which ever tab I select all the fields I drag in to it sit on top of one another rather than sit in the tab I choose. The o...

Outlook Closes After Closing an Email
When I click the 'X' to close an email after reading it, Outlook closes (or tries to close, but I get a warning because I have templates in my Outbox). This only seems to happen when I close a new email. I have Outlook 2003. Thank you. ...

YE Closing Procedures
The year end closing procedures need to be more efficient and user friendly. For example, the payables and receivable management is date sensitive except for amounts since last close, vendor yearly summary etc. These modules should be fully date sensitive and the ability to enter into multiple years without caveats should exist. Year end is stressful enough ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the b...

Customize right mouse button shortcut menu
Can the shortcut menu displayed on right mouse botton be changed? Thanks Art Hi as starting point some code: Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "Now you code yould start" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars(&q...

Permissions / Closing MDB left open
I need to learn how to create - well, I'm not actually sure what I need to learn... Let me explain: I'm a surgical resident. I've been working on an Access MDB as a patient census - for day-to-day management including tables, queries, and forms that print based on room number or service. Everything is setup as needed in the local file. I've been working on the content of the database on and off for a year. Recently, before I can implement my project, I realized I have a very big challenge to overcome related to usage of the file. Now, to complicate my iss...

Closed account not so closed?
Hi All... I have (had) an investment account with E*Trade, which I have since closed. In MS Money 2006, I have it as "Account Is Closed", in the account list. There are a few weird things going on: 1. When I go into the account list, this account appears in gray with $0.00 next to it, but the "To Review" column has "Update in Progress" in it. This account is definately not part of my regular online updates (though when it was active, it was). 2. When I click into this account, 2 securities are listed. Neither one of them has Quantity or Cost Basis,...