|
Hello,
I have an icon-style CListCtrl, into which I have inserted dozens of icons. Unfortunately, the icons never wrap onto a new row - they fill the top row, creating an unsightly horizontal scroll bar. I would prefer it if the icons wrapped onto a new row in a resolution-independent manner (so that the icons always filled the width of the CListCtrl), or at least never exceeded a certain width (so I know it won't display a scrollbar unless the user has a desktop resolution that is lower then 800x600, for example).
It is not apparent, having gone through MSDN documentation, codeproject tutorials and randomly googled MFC related pages, how any of this can be done. Could someone tell me what I should do?
Here is a codeproject tutorial. I would like to have large icons display as they do in the image of this dialog:
http://www.codeproject.com/KB/combobox/listctrldemo.aspx[^]
I've also made a considerable effort to copy this project, but cannot figure out why my Icon based CListCtrl won't wrap as described.
Thanks in advance,
Sternocera
|
|
|
|
|
What styles are you using for your list view control?
Have you tried LVS_AUTOARRANGE?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That's worked nicely, thank you.
|
|
|
|
|
Hi,
I have created a customized menu class which is derived from CMenu.
Can I handle right and left arrow keys on these menu. As CMenu is not derived from CWnd, how can we handle arrow keys on CMenu?
Thx in advance,
Vinayak
|
|
|
|
|
hi...
In my project am using many classes.
for example,
class1, class2, class3, class4, class5... etc.
i was declared like
CThreadClass* My_Thread;
in class1.
i need the same My_Thread variable for class4 and class5.
how can i use a comman variable for all clasess?
please help me....
thanks...
paulraj
|
|
|
|
|
can't you have it global, or pass it as classes constructors parameter ?
|
|
|
|
|
i have to get it as global
paulraj
|
|
|
|
|
Use a global variable or a Singleton pattern.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Use a global variable, as tox said. You need to be careful if your application is multi-threaded and more than one thread can have access to this variable.
Or, may be you are looking for something like this? :
class One
{
private:
bool bState;
public:
friend class Two;
friend class Three;
};
class Two
{
void BFunc()
{
One *var;
var->bState = true;
}
};
class Three
{
void CFunc()
{
One *var;
var->bState = false;
}
};
You will get better help, if you explain your problem clearly.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
...formerly known as brahmma
Codeproject.com: Visual C++ MVP
|
|
|
|
|
gnanapaul wrote: i was declared like
CThreadClass* My_Thread;
in class1.
Why not declare it in a base class that all the other classes are derived from?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
pls help me regarding!!!! the project is to help a disabled to move from a place to the exit in event of a fire or so,so we plan to give a software simulation for this situation,something which dynamically calculates the shortest path .....something like the maze game....please help me regarding this...how to start up with?????????
|
|
|
|
|
So, concretely, what do you want to know, and what do you want us to do ?
are you expecting us to do the job for you ?
|
|
|
|
|
no i just wanted to know should v have to adopt some algorithms for this?
|
|
|
|
|
If you can divide your space into 'cells' then have a look at the A* algorithm, it is quite powerfull for that purpose (just google for "A start pathfinding", you'll find plenty of links).
|
|
|
|
|
thanks for ur reply....is this algorithm apt for a project like this??pls do reply...
|
|
|
|
|
Well, if you just need to find the shortest path in a grid with certain cells being blocked, then yes. But it requires that you divide your space in squares and the shortest path will be given as a succession of cells. Is it sufficient for your needs ?
|
|
|
|
|
You need to research and become familiar with this.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
is it possible to get cursor position in multi line edit box.
I need this so I can insert some additional string in place of cursor position?
Thanks in advance.
|
|
|
|
|
Definitely u can.
use the CEdit::GetSel()
to find the cursor position even if there is not selection in the Edit control. it will return the start selection and end selection as same.
|
|
|
|
|
|
hi
i want to give ip address of the server to client from client dilog box
how it is
Girish
|
|
|
|
|
Your question is way too ambigious to make any sense. Please explain.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi All,
I have some FormView and on it i put some Dialog.
When i have button event of the mouse i want to catch the event by the dialog - but actually the event is caught by the FormView and i don't know how to change it.
Someone can help me ?
Thanks.
|
|
|
|
|
Catch the messages in the form view and relay them to your dialog.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Ok, but
1. How can i relay them to my dialog ? ( how to do it ? - call some method of the dlg ? )
2. Is there some other way ? How can i Catch the msg just in the Dialog and not in the FormView ? Is there is some way to make the FormView Skip some Message ?
|
|
|
|