when trying to click on a listbox created in runtime over an edit control in a formview, the existing edit control under the listbox control gets a focus. so i can't select an item in a listbox. somebody help me...
try either setting the z-order of the listbox to be in front of the edit control ... maybe destry the edit control ... disable it ... or use a combobox that allows the user to type stuff into the list control portfion and add some custom behaviour to stop the item being added to the list
"every year we invent better idiot proof systems and every year they invent better idiots"
How can I make my CFileDialog to accept directories and return the full path name of the directory. Something like what I get when I select File / New option in the MSDEV IDE and click on the "..." button next to Location Edit box ??
In your dialog editor, you do this by checking 'pop-up' for the item, then you can build a menu underneath it. I'm sure it can be done programatically, from memory by adding a menu to another, but I forget the details.
Hi, I'm working with a composite control in Visual C++...
Among other things I have a button on the dialog..
The problem is that I can't get it to react on me pressing the enterbutton.
I've tried overloading the pretranslatormethod but that doesnt work so good....
The reason it is *urgent* is that you've failed to apply the good advice on this question given several times already.
The function you need to call is called MoveWindow, the function that tells you the size of the screen is GetSystemMetrics, and you can override your OnSize function if you want to move your controls relative to your new window size.
If you find yourself still unable to fix this simple problem with the oodles of help you have recieved, consider posting the code you have written, so we can offer suggestions based on where you are going wrong.
The paint handler effects how the area is painted, not how big the dialog actually is. The handler under the check for IsIconic draws the icon.
You need to over ride OnInitDialog, where you can do what I suggested ( get the dimensions using GetSystemMetrics and call MoveWindow ), although MapDialogRect looks like a better idea, I have never used it before so I cannot comment. ( I intend to though, it looks useful ).
I'd suggest trying MapDialogRect first, and doing it in OnInitDialog.
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
CPaintDC dc(this); // device context for painting
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
//this->MoveWindow(cxIcon, cyIcon, x, y);
I'm not sure why you expect this to work, but I'd suggest that when people give you advice you seek to learn *how* something works so that you don't have to ask again. You have copied a lot of code that came for free in your OnPaint, which, as I explained before, has nothing to do with what you want.
Here is the total solution. Please take the time to understand how it works, it is with the hope that people will *learn* that I spend time here answering questions.
This moves the window to fit exactly onto the screen - you will probably have to subract from the last parameter in order to allow for the taskbar. I am not sure at this late hour how to go about figuring out the available screen area taking into account the taskbar - read up on GetSystemMetrics, it's probably there. Also, all of your individual objects in the dialog will remain where they are relative to 0,0 and may need to be resized. They can have MoveWindow called on them as well, by default they are derived from CWnd.
If I have an EXCEL file and I want the VISUAL C program to read data from that EXCEL file....Do you know how to do it?........I have tried the function fopen but they said I put the source code at the wrong function or something like that do you have any idea?
Have you tried using the ODBC Excel Driver found under System DSN. At least it is there on my machine, I believe from the instalation of VC++. You should then be able to access like a database using CRecordSet derived class.
Pegasystems Pty Ltd
I have an OpenGL application app based on MFC. I have a requirement that I need to redraw the whole scene every second(some sort of animation). When I use the standard method of invalidating the client area every second, the CPU usage is very high and my app does not respond to any other commands.
Can someone suggest any better ideas?
Last Visit: 31-Dec-99 19:00 Last Update: 4-Dec-21 1:38