tab control #10

hello

I am very new in programming

I have added a tab control in the main dialog that allow me to put different 
controls in each tab.
I have about 5 tabs
my problem is I want the controls on the tabs to communicate with the main 
dialog.

I am able to call the controls and the functions of the main dialog from any 
of the tabs by using eg

void CTab1::Onbuttom()
{
((CMainDlg *)GetParent())->m_msg.SetWindowText("Hello");

}

with this code if I click on a button on one of the tab page, it will write 
"hello" in the edit box in the
main dialog.

Now my problem is how do I do the oppoisite, that is if I have a buttom on 
the main dialog and the edit
box on the tab page, so that if I click on the button it will display 
"hello" in the edit box.

thanks 


0
dspman (15)
3/10/2006 6:26:30 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
399 Views

Similar Articles

[PageSpeed] 38

dspman wrote:
> hello
> 
> I am very new in programming
> 
> I have added a tab control in the main dialog that allow me to put different 
> controls in each tab.
> I have about 5 tabs
> my problem is I want the controls on the tabs to communicate with the main 
> dialog.
> 
> I am able to call the controls and the functions of the main dialog from any 
> of the tabs by using eg
> 
> void CTab1::Onbuttom()
> {
> ((CMainDlg *)GetParent())->m_msg.SetWindowText("Hello");
> 
> }
> 
> with this code if I click on a button on one of the tab page, it will write 
> "hello" in the edit box in the
> main dialog.
> 
> Now my problem is how do I do the oppoisite, that is if I have a buttom on 
> the main dialog and the edit
> box on the tab page, so that if I click on the button it will display 
> "hello" in the edit box.
> 
> thanks 

You need control member variables for each control that you want to 
access.  If you don't have control member variables (CEdit m_SomeEdit) 
add them.  Then your dialog can access them through the hierarchy of 
child windows, something like (from the dialog):
   m_tab.m_SomeEdit.SetWindowText("...")
or
   m_tab.m_Page3.m_SomeEdit...


-- 
Scott McPhillips [VC++ MVP]

0
Scott
3/10/2006 2:08:47 PM
Reply:

Similar Artilces:

Powerpoint 2003 05-04-10
Ever since migrating from XP to Vista, the powerpoint dialog box "Do you want to save changes" defaults to the "NO" button. How can I make the default the "Yes" button? thanks. ...

Sales for Outlook 10-18-05
I have uninstalled the Sales for Outlook, because I found an error when I’m going Offline. But after reinstalled the SFO, I found the following error “An error occurred while installing Micrososft CRM folders”. Someone can help on this? Thanks If you have access to Partnersource, you will want to search for the KB article on uninstalling the SFO client and make sure you hit all the steps. Then you will want to make sure you have either the latest hotfix rollup for CRM which allows the SFO to be installed by user accounts that are not local admins, or add the user to the local machin...

Loosing email addresses 04-09-10
Every time i am loosing my email addresses in lifemail Windows 7, can any one help me please The same thing is happening to me -I just keep losing the same contacts I make over and over -and I have searched for answers and cannot find any. "Sidewinder" wrote: > Every time i am loosing my email addresses in lifemail Windows 7, can any > one help me please > > . > If contacts continue to disappear, it might be appropriate to update the Contact.msi file(only deployed if Windows Live Essentials was installed after the last required WLMsgr upgrade...

can't send email 07-20-10
I keep gettin the same error for every message I send. Please help. See below. The connection to the server has failed. Subject '', Account: 'plus.pop.mail.yahoo.com', Server: 'plus.smtp.mail.yahoo.com', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket Error: 10060, Error Number: 0x800CCC0E Wrong port number, wrong SSL setting. For the correct settings see: http://help.yahoo.com/l/us/yahoo/mail/classic/mailplus/pop/pop-14.html Gary VanderMolen, Microsoft MVP (Mail) "amber" wrote in message news:4BB6D6A6-0214-4B05-914B-7BDC5D54B622@microso...

Font color in the cells 03-19-10
Hi, How about the way to change the color within VBA? -------------------------------------------------------------------------------- Many Thanks & Best Regards, HuaMin Chen Range("A1:A10").Font.Colorindex = 3 Refer the below for help on Colorindex http://www.mvps.org/dmcritchie/excel/colors.htm -- Jacob "HuaMin" wrote: > Hi, > How about the way to change the color within VBA? > -------------------------------------------------------------------------------- > Many Thanks & Best Regards, HuaMin Chen Thanks Jacob. I put that b...

Vlookup 05-11-10
I am using excel 2000 I am trying to use two columns to make the end result have a number in it I am not sure how to word it but I need S2 and R2 to reference the vlookup chart and give me the number that corresponds with it =vlookup(S2,R2,$H$1:$M$4,3,false) -- Message posted via http://www.officekb.com perhaps: =VLOOKUP(S2,$H$1:$M$4,3,FALSE) & VLOOKUP(R2,$H$1:$M$4,3,FALSE) or: =VALUE(VLOOKUP(S2,$H$1:$M$4,3,FALSE) & VLOOKUP(R2,$H$1:$M$4,3,FALSE)) ? On second thoughts, perhaps: =VALUE(VLOOKUP(S2 & R2,$H$1:$M$4,3,FALSE) ? Cerealkiller v...

Control Endpoint in USB Device
Given below are descriptors for my mass storage device obtained using USBVIEW application: ConnectionStatus: DeviceConnected Current Config Value: 0x01 Device Bus Speed: High Device Address: 0x03 Open Pipes: 3 Endpoint Descriptor: bEndpointAddress: 0x01 OUT Transfer Type: Bulk wMaxPacketSize: 0x0200 (512) bInterval: 0x01 Endpoint Descriptor: bEndpointAddress: 0x82 IN Transfer Type: Bulk wMaxPacketSize: 0x0200 (512) bInterval: 0x01 Endpoint Descriptor: bEndpointAddress: 0x83 IN Transfer...

Color to controls
How do I put color to controls? I have tried this but it does not work. Or, only a small part works. The edit control gets the requested color (yellow) but when I write something in it, the text background gets a quite different color (green). The button controls do not change color. What am I doing wrong? Any help will be apreciated Anders HBRUSH CMyCalculatorDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { if( nCtlColor == CTLCOLOR_EDIT ) { // 1 pDC->SetBkColor( 0xffffcc ); return (HBRUSH)(m_pEditBkBrush->GetSafeHandle()); } if( nCtlColor == CT...

activeX control problem with mouse event
I've written an activeX control and when i test it in the test container all the mouse event i told it to do (e.g. OnMouseMove, OnLButtonDown, etc.) works. However, when i use it on a MFC program that i'm writing, none of the mouse events work when i run the program. any one has any idea as to what's causing this? or How to fix it? Thank a bunch! ...

Running as a SPANISH user acts as thought the Control key is alwys down.
Our MFC-based software is such that a user can set it's preferred language to one of a number of Languages, including Spanish. When Spanish user logs into our system, it means nothing else than to perform all the string lookups in another table, besides english. Our strings don't come from Resource files, but rather from a Database table. Other than that - everything is English - the OS, the keyboard, etc - it's just that we're displaying spanish text and characters. Here's the problem - When typing into an MFC-based edit box, the keys behave as though the Control Key is ...

Pivot Table 05-12-10
I want to format a pivot table in such that each of the blank cells in a column can be formatted to be blank instead of the words (blank) in the cell. On May 12, 11:19=A0am, dwake <dw...@discussions.microsoft.com> wrote: > I want to format a pivot table in such that each of the blank cells in a > column can be formatted to be blank instead of the words (blank) in the c= ell. Instead of blank, what about invisible? Use a conditional formatting that changes values that equal (blank) to a white font, the values will no longer appear in the worksheet, unless highlighted ...

Active X controls
Ok, I have a issue understanding how to use the Active X contols. I wa trying to create a "combo drop down box", which I can do, I just can no figure out how to assign list of data to it. Anyone know how to d this -- dksorea ----------------------------------------------------------------------- dksoreal's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=222 View this thread: http://www.excelforum.com/showthread.php?threadid=38332 Click on the 'properties' icon on the control toolbox and it will display a properties window. Look for the List...

Register an ActiveX control with the Pocket PC 2003 Emulator #2
Hi, Is there anyone who knows how to register an Activex control with the Pocket PC 2003 Emulator? I successfully registered the control my PC using regsvr32. But when I inserted it in the application (a simple MFC dialog for enbedded devices), the main thread exit giving the following error. CoCreateInstance of OLE control {058E370E-6141-4E41-8B95-846EE04BB303} failed. >>> Result code: 0x80040154 >>> Is the control is properly registered? Warning: CreateDlgControls failed during dialog init. Can anyone help on this? Regds, Amila ...

Reports 10-11-07
I have a form that has a field called "Item" among other fields. The form is derived from a query. The Item field is composed of a 4 digit number followed by a description. I also have a report based on the form's query. The report has a parameter requesting what "Item" number do I want the report to select. I would like to be able to only type in the Item number and not the full description to run the report. How can this be accomplished? Thanks -- Delore On Oct 11, 5:57 pm, Delore <myoffice.com> wrote: > I have a form that has a field called "It...

Linking Tabs
Hi Ill try explain as best I can - If I have all the information I need on the first tab in my work book and I then need to split this information and copy it into another 2 seperate tabs. If i then change any data written or numbers on the first tab how can i make the inaformation automatically change in the other 2 tabs so all info is eaxactly the same even thought its been split up? I have tried paste special and it does not seem to like this Any help greatly appreciated When you first copy the data and then navigate to the new sheet, instead of simply pasting the data, right click ...

Pivot tables 03-18-10
Is it possible to hide items in a Pivot Table if their count is below a threshold of 5? I am using excel 2007. I'm trying to shorten a pivot table number of items based on the count of those items. Count of 5 (see above) is just a guess, it could end up a different number. Thanks Steve ...

Control formula calculation
I have created a "form" where a user enters 2 separate numbers. I wan each of these numbers to input to a running total and the total t subtract from another number... this is what I have come up wit (understand it is a circular ref ..) 1 2 User input 2 User input 2 Prior input 0Prior input 0 Total input 2 Available 36 Remaining 3 -- Message posted from http://www.ExcelForum.com ...

Using Comport control under vba
I want use comport control in vba for receiving data from comport and put this in MSGP. Will anyone can help me that how can i do this. ...

Remove duplicate Entries from List Control
Hello, I was interested in removing duplicate entries from my List Control. Its using Report_View, and it has 3 columns. If someone decides to add an entry to the list control, I would like to not add it, if it is already in the list. Is there a way? It would seem tedious to have to check for every entry, whether it exists or not. You could probably use the list control FindItem() call to look for specific entry information: http://msdn2.microsoft.com/en-us/library/4xetd6cd.aspx I don't know of a way to just preclude duplicates. Tom "Jon" <TheFakeJon@gmail.com> w...

default tabs #2
how do i change default tabs in Publisher 2003? mike wrote: > how do i change default tabs in Publisher 2003? Care to elaborate...? What do you mean by 'tabs'? -- In memory of MS MVP Alex Nichol: http://www.dts-l.org/ TABS are just like they are in WORD and just like they are described in HELP....RTFM. -- John G Wot's Your Real Problem? "Miss Perspicacia Tick" <test@test.com> wrote in message news:A0B9e.444$5I1.132@fe06.highwinds-media.phx... > mike wrote: >> how do i change default tabs in Publisher 2003? > > Care to elaborate...? W...

Move Column to Next Tab
Hi, I've seen a lot of posts about moving rows to the next tab, but none on columns. I have tried changing code from rows to columns, but have not been able to get anything to work. Based on a data validation cell being changed from "Active" to "Inactive" in Row 3 of the column, I would like any column changed to Inactive to be moved to the next tab, a sheet is named "Archive". First column is F, and range is F2:F1202, if that helps. Thanks! -- Cell Block ...

VBA to Pull info from 2 diff tabs from the same spreadsheet
Hi All, I need your help please. I need to pull data from 2 different tabs from the same spreadsheet. The code down below after the first "end with" works when it is run alone, however, when I add the the code at top (to pull from the other tab) it doesn't work. i know it looks messy and crazy but would anyone know how to pull data from 2 tabs within the same spreadsheet? I'm hoping it's a simple fix. Sub HSSESafetyQuestions() Dim fso, f, fldnm As String, WB As Workbook, WS As Worksheet, r As Long Dim ws2 As Worksheet Set fso = CreateObject("Scripting.File...

Backlight control and Touch screen tapping
Hello, After modifying the Power Manager to manage User Activity, I'm able to turn off the LCD backlight after a timeout. The system has a touch screen. Tapping on it, the user causes an event that is able to clear the User Activity timeout and to turn the backlight on again. But.. the user is blindly tapping on a live (but black) application screen, so this event can do random and bad things! I have this problem with different architectures and mostly with a binary version of the touch screen drivers. Is there a general and clean method to use the first event of the touch...

Excel+Word 10.1.5 toolbar icons: no Entourage-like interp?
In Entourage X, if I point the mouse at an icon in a toolbar and pause, a few words appear that interpret what the tool is or does. But if I try to do the same in Excel 10.1.5 or Word 10.1.5, I see nothing. Is there something one can see while working in either Word or Excel, that makes clear what the default toolbar icons do? Or is there a chart that one can print showing the default toolbar icons with one or couple-word interpretations? In article <BBEE3443.E6E5%nnager@NoXSpXam.fullerton.edu>, "Norman R. Nager, Ph.D." <nnager@NoXSpXam.fullerton.edu> wrote: > ...

ActiveX control blocking the GUI
Hello, I am developing a simple dialog based MFC application which contains one ActiveX control that performs some image aquistion from external devices and displays the image in its window (live preview). Besides this control, the dialog has two buttons: one that starts the image aquistion with this controls and the other that stops/aborts it (by sending an "ESC" keypress message to this control's window). The actual aqusition process is started in the first button's BN_CLICKED notification message handler with a call to this control's appropriate interface method, and ...