|
Thanks prasad
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
I added one edit control in my dialog. I restricted to number only. It is a normal edit box. In properties I made it to number only. In normal key press event user can not enter other than numbers. But when i given to tester, he is trying to copying the data from else where and pasteing in this edit box. Any simple way to restrict this copy and paste one. (Other than creating our own deriving CCustomEdit). any clues friends...
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
You can try EN_CHANGE or EN_UPDATE to validate the text in the control
Do your Duty and Don't expect the Result
|
|
|
|
|
Thanks it is working fine. Done . I used EN_UPDATE.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
I am making a dialog based project in VC++ and in my form in one edit box
i want to ckeck that the mail id entered by user correct or not.
for this i write the code below.
Please tell me what function i have to use for that.
CString sMail;
GetDlgItemText(IDC_EDIT_EMAIL,sMail);
if( (!strcmp(sMail,"")) ||! strcmp("^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.*", sMail))
{
MessageBox("please enter valid Email");
}
Please told me here i am using function strcmp for matching alphabetic characters is correct or not.
mailing me
Yogi
|
|
|
|
|
If user enters three @ symbols how do you checking? if user enters three dots in all places how do u check?
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
yogikaushik wrote: strcmp("^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.*", sMail))
You cannot use strcmp like this..
the string given inside the quotes will be taken as such, i.e., strcmp has no intelligence to interpret your logic here.
Better you can find different parts of email and check it for unacceptable chars in it.
Many string functions are available, say strchr or CString::Find(..),..
Do your Duty and Don't expect the Result
|
|
|
|
|
what should be code for resizing the image drawn(zoom in and zoom out)drawing in pixels
Problems are to be solve
|
|
|
|
|
kindd wrote: code for resizing the image drawn(zoom in and zoom out)
Redraw the image with desired size.
Say you have drawn the image 50,50 - 100,100
-- then to zoom in, draw the same image from 40,40 - 110,100
-- to zoom out, draw the same image from 60,60 - 90,90
You can use, BitBlt or StretchBlt from CDC class
or
DrawImage from GDI+ Image Class
Hope i understood your question...
Do your Duty and Don't expect the Result
|
|
|
|
|
for a map to view clear by zoom in and zoom out, any thing further that helps in coding?
nill
|
|
|
|
|
kindd wrote: map to view clear by zoom in and zoom out
Use CDC::StretchBlt
Say pBitmap is your map and dc is your DC then,
CDC cdc; cdc.CreateCompatibleDC(&dc);
CBitmap* pOldBitmap = cdc.SelectObject(pBitmap);
dc.StretchBlt(x, y, width, height, &cdc, sx, sy, swidth, sheight, SRCCOPY);
cdc.SelectObject(pOldBirmap);
cdc.DeletcDC();
Here x,y,width,height are your destination rect, it will remain same for both zoom in and zoom out.But sx,sy,swidth,sheight are your source and it will vary for zoom in and zoom out and the specified source rect is what you have to zoom in/out...
Do your Duty and Don't expect the Result
|
|
|
|
|
How to set minimize or maximize button on property sheet
|
|
|
|
|
I also have the same question... and even more i want to know how can i shift those at bottom??
Megha
|
|
|
|
|
megha_gharote wrote: I also have the same question...
Me too jus kidding..
Did you try to add WS_MINIMIZEBOX style to the property sheet window? What happens if you do? Moreover, why is that you need to minimize a property sheet? I am asking this just out of curiosity.
-- modified at 2:45 Thursday 22nd March, 2007
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
brahmma wrote: WS_MINIMIZE
Correction, WS_MINIMIZEBOX .
|
|
|
|
|
Thanks, corrected.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Come on ! No need to mention it.
|
|
|
|
|
megha_gharote wrote: and even more i want to know how can i shift those at bottom??
What ?
|
|
|
|
|
|
As bramha said earlier, why you needed it ?
Any way, use WS_MAXIMIZEBOX or WS_MINIMIZEBOX style for property sheet.
You can override OnCreate to look it like this,
int CMySheet::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
return -1;
ModifyStyle(0,WS_MAXIMIZEBOX);
return 0;
}
This is just one way to add the style, You can use PreCreateWindow for same purpose,too.
|
|
|
|
|
It is not working. I am creating a propertysheet using DoModal() function and I want to put maximize and minimize button on the main window of propsheet. I tried using onCreate function and PreCreateWindow() function but It isnot working if I modify the dwStyle DWORD in the fuction.I even tried calling these functions explicitly in the constructor also( I know I should not do that)
What to do.....
-- modified at 5:18 Thursday 22nd March, 2007
|
|
|
|
|
If u want to add new buttons on Property sheet.. then u can try out this code
BOOL CGeomeSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
// TODO: Add your specialized code here
// A pointer to button we will need
CButton *btnApply;
// We will need to location and dimensions of the Apply button
CRect RectApply;
// Get a handle to the Apply button
btnApply = reinterpret_cast<cbutton *="">(GetDlgItem(ID_APPLY_NOW));
// Get the location and the dimensions of the Apply button
btnApply->GetWindowRect(&RectApply);
// Convert the location and dimensions to screen coordinates
ScreenToClient(&RectApply);
CButton *Whatever = new CButton;
Whatever->Create("&Whatever", WS_CHILD | WS_VISIBLE,
CRect(6, RectApply.top, 85,
RectApply.top+RectApply.Height()),
this, 0x188);
return bResult;
CFont ctlFont;
ctlFont.CreateStockObject(DEFAULT_GUI_FONT);
Whatever->SetFont(&ctlFont, FALSE);
}
For more details u can go through http://www.functionx.com/visualc/
Megha
|
|
|
|
|
Hey Prasad,
buddy answer my question also ..
How to shift those buttons down.. and if we want to add two dialogues on a single prperty page how can we achieve it???
Help plzzzzzzzzzz
Megha
"Friend in Need is a friend Indeed"
|
|
|
|
|
|
Thank u Prasad for such a quick reply....
I have gone through this section but didn't get the datails..
I have added to pagaes in a property sheet and their names are coming as tabs on top. i want those tabs at bottom.. how can we do tht?
Can we put two dialog boxes in a single property page at the same time??
help needed urgently
Megha
friend in need is a friend indeed
|
|
|
|