Edit boxes
-
Hello, I'm currently writing a win32 application and I was wondering how I could make an address bar, like Internet Explorer, for the top of my program? Thanks, Caleb
-
Hello, I'm currently writing a win32 application and I was wondering how I could make an address bar, like Internet Explorer, for the top of my program? Thanks, Caleb
You can use a ComboBox for the adressbar and insert the adress with
m_myCbo.Addstring()
. If you want to show the adresses which are inserted before and you run the programm again write it into the registry or in an *.ini-file withWriteProfileString and GetProfileString()
. Example:CString strSection = "My Section"; CString strStringItem = "My String Item"; CString strIntItem = "My Int Item"; CWinApp* pApp = AfxGetApp(); pApp->WriteProfileString(strSection, strStringItem, "test"); CString strValue; strValue = pApp->GetProfileString(strSection, strStringItem); ASSERT(strValue == "test"); pApp->WriteProfileInt(strSection, strIntItem, 1234); int nValue; nValue = pApp->GetProfileInt(strSection, strIntItem, 0); ASSERT(nValue == 1234);
The ini-file got the name of your programm and you can find it under C:\Windows\ or C:\Winnt\. P****R -
Hello, I'm currently writing a win32 application and I was wondering how I could make an address bar, like Internet Explorer, for the top of my program? Thanks, Caleb
1. Create the address bar like dialog window in Resource editor. Set the style CHILD and border NONE. 2. In
CMainFrame
class declaration add:CDialogBar m_wndAddressBar;
CReBar m_wndReBar;3. In
CMainFrame::OnCreate()
add:m_wndAddressBar.Create(this, IDD_ADDRESSBAR, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
m_wndReBar.Create(this);
m_wndReBar.AddBar(&m_wndAddressBar);The
IDD_ADDRESSBAR
is the resource ID of your address bar in Resource editor. Robert-Antonio -
1. Create the address bar like dialog window in Resource editor. Set the style CHILD and border NONE. 2. In
CMainFrame
class declaration add:CDialogBar m_wndAddressBar;
CReBar m_wndReBar;3. In
CMainFrame::OnCreate()
add:m_wndAddressBar.Create(this, IDD_ADDRESSBAR, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
m_wndReBar.Create(this);
m_wndReBar.AddBar(&m_wndAddressBar);The
IDD_ADDRESSBAR
is the resource ID of your address bar in Resource editor. Robert-AntonioThanks for your replies!