|
Hi all,
How can I increase/decrease the size of the property page?
Thanks in advance
- NS -
|
|
|
|
|
There are several article here to solve this problem.
Greetings from Germany
|
|
|
|
|
NS17 wrote: How can I increase/decrease the size of the property page?
The size of the sheet is governed by the size of the smallest and largest pages.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I use a customized tab in the property sheet. I need to extend the page to the border of the tab control. That is what I actually needed.
FYI: I solved the issue by handling the WM_WINDOWPOSCHANGING in the page.
But this solution has disadvantage that i need to do it in all the pages.
- NS -
|
|
|
|
|
And why dont you make a generic function using the identifier of the sheet as parameter? and then call the function changing the parameter when a sheet is becoming visible.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I am sorry. I didnt get you.
- NS -
|
|
|
|
|
If your problem is that you have to change the size in every sheet. Insteads of coding one function per every sheet, you can make it with just a function and calling it when a sheet changes before the datas are shown.
To do that, you can take a pointer/handler to every sheet and give it as parameter to the function. Then code the change of size to the concrete sheet.
for example:
void ChangeSheetSize (CWnd* pWnd)
{
}
CPropertyPage::OnSetActive ()
{
CWnd* pWnd = GetActiveWindow ();
ChangeSheetSize (pWnd);
}
Im not sure if there is a better way, but I think it can work
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I did not tried it, but it should be done in each page. I was seeking for a solution, that is independant from page. Means it should be done in the sheet or elsewhere, so that no repeated coding is needed.
- NS -
|
|
|
|
|
With the idea I gave you, the only lines of code you should repeat are:
CPropertyPage::OnSetActive ()
{
CWnd* pThisPropPageWnd = GetActiveWindow ();
ChangeSheetSize (pThisPropPageWnd);
}
The function of changing size needs to be written just once. In the parent window/view that is containing the different property pages.
so it should be somthing like:
pParentWnd->ChangeSheetSize (pThisPropPageWnd);
But... I'm not 100% sure about.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
NS17 wrote: I use a customized tab in the property sheet. I need to extend the page to the border of the tab control.
Sorry, but I'm not following.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Actually there is a little gap ( approximately 3 pixels ) between tab control border in the property sheet and border of property page. So I need to enlarge the property page to fit to the tab control borders.
Hope you got what I meant.
- NS -
|
|
|
|
|
NS17 wrote: So I need to enlarge the property page to fit to the tab control borders.
So enlarge it in the resource editor. What's hard about that?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
But tab control size is managed by the property sheet, right? So always there will be a gap between the tab controls' border and that of page...
- NS -
|
|
|
|
|
NS17 wrote: But tab control size is managed by the property sheet, right?
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
When using ioctl() to set SIO_RCVALL in order to be able to use recvfrom() to "sniff" all incoming and outgoing packets, will TCP packets already be "ordered (arrive in same order as sent)" and and reliable in the sense that a copy of an already received packet can arrive at a later time?
Or does SIO_RCVALL hook the packets before the tcp implementation have done its work, and you have to do this ordering and detecting dupes yourself?
Thanks
|
|
|
|
|
Hi guys,
I've got some problem with C++/MFC application. Now I would like to put the blank line in excel between different date.
I already done to create output Excel file. In my file is -
//create the time object
CString strTime = now.format (_T("%d/%m/%y %H:%M%S"));
CString str;
str.format ( _T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
m_file.WriteString (str);
the strTime is to display the current time. I want to do when the datetime column is differnent data, just put the blank line.
example line -
RSVP-test-1 username The sentence The sentence 100% 18/09/07
RSVP-test-1 username The sentence The sentence 100% 19/09/07
Can anyone help me ?
|
|
|
|
|
tunminhein wrote: I want to do when the datetime column is differnent data, just put the blank line.
Can't you just add another '\n' to str ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi David,
very useful answer. but I don't want to get gap line every line.
just want it, when the date time is different.
Thank you very much
tunminhein
|
|
|
|
|
Obviously you'll need to compare the previous time with the current time and only add the extra '\n' when they differ.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank a lot david,
I'll try it now.
regards,
tunminhein
|
|
|
|
|
Excause me again, David
How can i get the data from excel column 6.
thanks a lot.
|
|
|
|
|
tunminhein wrote: How can i get the data from excel column 6.
Without any more data than you've provided, I don't know. I would presume in the opposite manner in which you are setting the data in column 6.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for respone.
the following is codeing -
#include "StdAfx.h"
#include "DataCollector.h"
#include "lmcons.h" // for UNLEN and DNLEN [Dave]
CDataCollector::CDataCollector(void)
{
}
CDataCollector::~CDataCollector(void)
{
}
void CDataCollector::Open(LPCTSTR path)
{
m_file.Open (path,CFile::modeCreate | CFile::modeNoTruncate |
CFile::modeWrite | CStdioFileEx::modeWriteUnicode );
m_file.SeekToEnd ();
}
void CDataCollector::Close()
{
m_file.Close ();
}
void CDataCollector::Write(LPCTSTR lesson,
LPCTSTR sentence, LPCTSTR attempt, double score)
{
// To get user name
CString s;
DWORD userNameLength = UNLEN + 1;
TCHAR userName[UNLEN + 1]; // System user name length + 1.
if (GetUserName(userName, &userNameLength))
{
/* get network name */
// The NetApi calls are very time consuming
// This technique gets the domain name via an
// environment variable
TCHAR domainName[DNLEN + 1]; // System domain name length + 1
if (ExpandEnvironmentStrings(_T("%USERDOMAIN%"), domainName, DNLEN + 1))
{
s += domainName;
s += '-';
} /* get network name */
s += userName;
}
//create the time object
time_t osBinaryTime;
time(&osBinaryTime);
CTime now(osBinaryTime);
CString strTime = now.Format(_T("%d/%m/%y %H:%M:%S\n "));
CString str;
str.Format(_T("\n"));
str.Format(_T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
m_file.WriteString (str);
}
thanks a lot 
|
|
|
|
|
tunminhein wrote: str.Format(_T("\n"));
str.Format(_T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
What exactly are you expecting this to do? The second call to Format() just overrides what the first one did.
In any case, you need to compare:
if (last_time != strTime)
m_file.WriteString(_T("\n"));
str.Format(_T("%s, %s, %s, %s, %3.0lf%%, %s \n"), lesson, s, sentence, attempt, score, strTime);
m_file.WriteString (str);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks a lot david
but we didn't put anydata to last_time ?
Regards,
|
|
|
|