|
I hope you just picked the combo and placed it to dialog. If you did so, by default the dropdown list size will be small to occupy only one item. So do the following
1) After placing the combo to the dialog in resource editor, click on the drop down arrow and dropdown size change rect will appear.
2) Drag the dropdown size selection so that you can see bigger list.
If you want to do it via code, send CB_SETMINVISIBLE to the combobox by specifying the minimum number of items visible in the combo.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi Jijo,
Thanks for the help!!
Design time sizing of control is working well.
To do it in code, sending message only is enough or do we need to something else like creating manifest file..
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Just send the message. That will be enough. I'm sure that the combo will hear your message.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi,
I added a new form and associated to the CView Class, and i wannted to add The OnCreateClient usinf the wizard but i didn't find it.
Is that a stupid question or what? how can i add that Function. Thx
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Hi,
Do you want override it?
Refer this page: CFrameWnd::OnCreateClient[^]
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Blood_HaZaRd wrote: and associated to the CView Class, and i wannted to add The OnCreateClient usinf the wizard but i didn't find it.
That's because OnCreateClient() is a CFrameWnd method, not a CView method.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
I created a dialog window. After the user enters data, he can select OK or CANCEL and the window automatically closes. I wanted to add a button called "TEST" to this same dialog. When the user clicks on the "TEST" button, I want to automatically close this dialog window just as it happens when he clicks OK or CANCEL. But I don't know how to set things up to do that.
Thanks!
|
|
|
|
|
In your test button handler call
CDialog::OnOK();
Then your dialog will be closed automatically. Actually the CDialog::OnOK() calls UpdateData() to update data from controls to member variables and calls EndDialog() to close the dialog.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks a lot. That was incredibly simple! Thanks again!
|
|
|
|
|
or CDialog::OnCancel if the datas don't have to be saved :P
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Very true.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Well you can insert a button to your dialog box and insert OnOK() or EndDialog() on this button.
|
|
|
|
|
I know there is BOM that we can get the coded format of a file.
But utf-8 has two format with BOM and without BOM.
How can I get that coded format?
And is there a easy way to get the coded format of a file?
I am in china.
the coded format has utf-8 Unicode ANSI GBK GB2312 BIG5 ...
|
|
|
|
|
Like a pair, for the first field, the value is unique, and the second field, the value is also unique. And I can quickly use one field to find another. Is there such a template class?
|
|
|
|
|
What about a class that contains the datas you need and a CList of it?
Take a look to http://www.codeproject.com/KB/recipes/SmartListII.aspx[^], it may help you.
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
followait wrote: Like a pair, for the first field, the value is unique, and the second field, the value is also unique. And I can quickly use one field to find another. Is there such a template class?
Since your first field is unique and you want to lookup the second field by using first, map will be the best choice. You can use either CMap or std::map .
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Yes, the bimap[^]
Graham
Librarians rule, Ook!
|
|
|
|
|
I save a CBitmap object to disk with this code :
CDC * pDC = GetDC();
CBitmap Bitmap;
Bitmap.CreateCompatibleBitmap(pDC,screenMaxX, screenMaxY);
Image.Attach(Bitmap);
Image.Save(_T("xxx.bmp"));
but the bitmap I saved was completely black
Some one plz help me
|
|
|
|
|
capint wrote: Bitmap.CreateCompatibleBitmap(pDC,screenMaxX, screenMaxY);
Image.Attach(Bitmap);
this creates only the bitmap object, allocates resources for the bitmap and the color format is compatible with the Device context, but the image it initially contains is blank, you need to fill the image in to the allocated bitmap resource.
I assume you want the image in the Device context then you need to copy the bitmap from dc to this bitmap,
CBitmap Bitmap;
Bitmap.CreateCompatibleBitmap(pDC,screenMaxX, screenMaxY);
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = dcMemory.SelectObject(&Bitmap);
dcMemory.BitBlt(0, 0, screenMaxX, screenMaxY, pDC,
0, 0, SRCCOPY);
dcMemory.SelectObject(pOldBitmap);
|
|
|
|
|
Thanks so much
|
|
|
|
|
|
DirectX9 Surface support alpha-channel and can be loaded from .png file. How can I make them draw with transparency ?
|
|
|
|
|
"A Microsoft® Direct3D® device is a state computer", you need to enable/set the render states for Transparency. see [Alpha Blending State ^] you need to use the D3DRS_ALPHABLENDABLE render state to enable alpha transparency blending and set the blending type.
|
|
|
|
|
from the above link:
The alpha value of a color controls its transparency. Enabling alpha blending allows colors, materials, and textures on a surface to be blended with transparency onto another surface.
In my game, I just need to draw .png images with alpha, the same size they are. I've got a lot of those for drawing a complicated animation. I've got about 650 images.
I find the textures interface unsuitable, because of their creation cost, and the fact they don't natively looked exactly as the images.
So, I'm using D3DxCreateSurfaceFromFile() and later ID3DDevice::StretchRect() to draw on the bacbuffer surface.
It seems to me like the SetRenderState() capabilities do not apply to DirectX9 surfaces. But I do guess there is some way to alpha-blend surfaces because they contain alpha-channel color.
|
|
|
|
|
Hanan888 wrote: The alpha value of a color controls its transparency. Enabling alpha blending allows colors, materials, and textures on a surface to be blended with transparency onto another surface.
have you seen "on a surface" to another surface. without enabling alpha blending state, you are not going to get transparency from Direct 3D, which doesnot do/skips any alpha blending calculation on the device.
Hanan888 wrote: It seems to me like the SetRenderState() capabilities do not apply to DirectX9 surfaces
have you tried?
Hanan888 wrote: So, I'm using D3DxCreateSurfaceFromFile()
AFAIK, D3DxCreateSurfaceFromFile is not dx9 API, may be you are using some wrapper which creates a surface and uses D3DXLoadSurfaceFromFile API.
|
|
|
|