Click here to Skip to main content
15,895,656 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: TFTP Sample code Pin
Hamid_RT30-May-08 2:38
Hamid_RT30-May-08 2:38 
AnswerCP IGNORE Pin
leckey31-May-08 16:43
leckey31-May-08 16:43 
QuestionVista & MDI Pin
CodyDaemon29-May-08 0:49
CodyDaemon29-May-08 0:49 
QuestionRe: Vista & MDI Pin
David Crow29-May-08 3:24
David Crow29-May-08 3:24 
AnswerRe: Vista & MDI Pin
CodyDaemon29-May-08 4:11
CodyDaemon29-May-08 4:11 
QuestionResource file adding resource problem. Pin
ritz123429-May-08 0:29
ritz123429-May-08 0:29 
AnswerRe: Resource file adding resource problem. Pin
SandipG 29-May-08 0:50
SandipG 29-May-08 0:50 
GeneralRe: Resource file adding resource problem. Pin
ritz123429-May-08 0:59
ritz123429-May-08 0:59 
This is the function that makes the control hide/visible
void MainDlg::ShowTabData(int nTab)
{

	try
	{

		HWND hWnd;
		CButton *ob1=(CButton*)GetDlgItem(IDC_AUTO);
		CButton *ob2=(CButton*)GetDlgItem(IDC_MANUAL);
		CEdit *Eob=(CEdit*)GetDlgItem(IDC_PASSWORD);
		switch(nTab)
		{
		case 2:
			//AfxMessageBox("Organization");
                        //Newly added controls in the dialogbox
			GetDlgItem(IDC_STATIC4)->ShowWindow(true);
			GetDlgItem(IDC_ORG)->ShowWindow(true);
                       
			GetDlgItem(IDC_STATIC1)->ShowWindow(false);
			GetDlgItem(IDC_STATIC2)->ShowWindow(false);
			GetDlgItem(IDC_STATIC3)->ShowWindow(false);
			GetDlgItem(IDC_USER)->ShowWindow(false);
			GetDlgItem(IDC_PASSWORD)->ShowWindow(false);
			GetDlgItem(IDC_URL)->ShowWindow(false);

			GetDlgItem(IDC_AUTO)->ShowWindow(false);
			GetDlgItem(IDC_MANUAL)->ShowWindow(false);

		case 1: 
			//AfxMessageBox("Login");
			// Make First Tab Visible
			GetDlgItem(IDC_STATIC1)->ShowWindow(true);
			GetDlgItem(IDC_STATIC2)->ShowWindow(true);
			GetDlgItem(IDC_STATIC3)->ShowWindow(true);
			GetDlgItem(IDC_USER)->ShowWindow(true);
			GetDlgItem(IDC_PASSWORD)->ShowWindow(true);
			Eob->SetPasswordChar('*'); 
			GetDlgItem(IDC_URL)->ShowWindow(true);

			SetDlgItemText(IDC_USER,m_strUserName); 
			SetDlgItemText(IDC_PASSWORD,m_strPassword); 
			SetDlgItemText(IDC_URL,m_strUrl);

			// Make Second Tab Invisible
			GetDlgItem(IDC_AUTO)->ShowWindow(false);
			GetDlgItem(IDC_MANUAL)->ShowWindow(false);
			break;
		case 0: 
			//AfxMessageBox("Upload");
				// Make First Tab Visible
			GetDlgItem(IDC_STATIC1)->ShowWindow(false);
			GetDlgItem(IDC_STATIC2)->ShowWindow(false);
			GetDlgItem(IDC_STATIC3)->ShowWindow(false);
			GetDlgItem(IDC_USER)->ShowWindow(false);
			GetDlgItem(IDC_PASSWORD)->ShowWindow(false);
			GetDlgItem(IDC_URL)->ShowWindow(false);

			// Make Second Tab Invisible
			GetDlgItem(IDC_AUTO)->ShowWindow(true);
			GetDlgItem(IDC_MANUAL)->ShowWindow(true);
			
		}
		
		
	}
	catch(...)
	{
	}

}


This Above function is called by the following function

void MainDlg::OnSelchangeOptionTabs(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	try
	{
		CString strtab;	
		int ISel=m_Tab->GetCurFocus();
		ShowTabData(ISel);
		*pResult = 0;
	}
	catch(...)
	{
	}
}


ritz1234

GeneralRe: Resource file adding resource problem. Pin
SandipG 29-May-08 1:12
SandipG 29-May-08 1:12 
GeneralRe: Resource file adding resource problem. Pin
ritz123429-May-08 1:37
ritz123429-May-08 1:37 
QuestionRe: Resource file adding resource problem. Pin
David Crow29-May-08 3:28
David Crow29-May-08 3:28 
AnswerRe: Resource file adding resource problem. Pin
ritz123429-May-08 4:00
ritz123429-May-08 4:00 
GeneralRe: Resource file adding resource problem. Pin
David Crow29-May-08 4:08
David Crow29-May-08 4:08 
GeneralRe: Resource file adding resource problem. Pin
ritz123429-May-08 4:33
ritz123429-May-08 4:33 
QuestionRe: Resource file adding resource problem. Pin
David Crow29-May-08 4:37
David Crow29-May-08 4:37 
AnswerRe: Resource file adding resource problem. Pin
ritz123429-May-08 4:48
ritz123429-May-08 4:48 
QuestionRe: Resource file adding resource problem. Pin
David Crow29-May-08 5:24
David Crow29-May-08 5:24 
AnswerRe: Resource file adding resource problem. Pin
ritz123429-May-08 5:26
ritz123429-May-08 5:26 
QuestionVS 2005 Resource Editor Pin
Brian Dunne28-May-08 23:18
Brian Dunne28-May-08 23:18 
AnswerRe: VS 2005 Resource Editor Pin
SandipG 28-May-08 23:21
SandipG 28-May-08 23:21 
GeneralRe: VS 2005 Resource Editor Pin
Brian Dunne28-May-08 23:25
Brian Dunne28-May-08 23:25 
GeneralRe: VS 2005 Resource Editor Pin
SandipG 28-May-08 23:27
SandipG 28-May-08 23:27 
GeneralRe: VS 2005 Resource Editor Pin
SandipG 28-May-08 23:32
SandipG 28-May-08 23:32 
GeneralRe: VS 2005 Resource Editor Pin
Brian Dunne28-May-08 23:33
Brian Dunne28-May-08 23:33 
AnswerRe: VS 2005 Resource Editor Pin
David Crow29-May-08 3:30
David Crow29-May-08 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.