|
Ranjoy Guha wrote: First use
CListCtrl::DeleteAllItems()
You don't need to delete all items and redraw everything again. This is the worst way of doing it. CListCtrl::InsertItem is enough to insert new items.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Suppose previously there was 15 items
later there is 10 items
then the previous 5 will stay
|
|
|
|
|
Ranjoy Guha wrote: Suppose previously there was 15 items
later there is 10 items
then the previous 5 will stay
I don't understand what you tell. It is simple logic, you don't need to delete everything to add something new and display it.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Suppose There are different Criteria
1. Student: having Properties (Name, Class, Roll, Age)
2 Teacher: having Properties (Name, Degree, Designation)
And u need to update them depending on the selected Criteria(Student/Teacher)
Now if you dont perform DeleteAllItems then the List Control will keep on growing with each selection. Isn't It ?
|
|
|
|
|
The OP asked how to add new data and update the view. Link[^]
Now on what grounds do you ask someone to delete all items?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Ranjoy Guha wrote: then the previous 5 will stay
This is why DeleteAllItems() should be used. It's the two for loops that you had that were in question. The second one was unnecessary.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I use Visual Studio 2005
Are there a limitation of number of controls (for example CStatic) in same dialog.
I try to add a static in my dialog, i save but when i reopen my dialog in Visual Editor, i don't have my control added. Impossible to add a other controls.
Anybody know about it?
Thanks
|
|
|
|
|
Yes, but it's REALLY big.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
it seem limitation is 256 not very big
|
|
|
|
|
jerome_data wrote: it seem limitation is 256 not very big
256 is not the limit.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
brahmma wrote: 256 is not the limit.
So what is it then? Has it been increased with VS2005?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Why in this world, would you ever need that many controls into one single dialog ?
|
|
|
|
|
because nothing is easy and nothing is white or black
|
|
|
|
|
Hi,
//Static text control pointer pWidthWnd
//getting width of static text control
pWidthWnd->GetClientRect(&rect);
//rect.right -= 15;
//maxPath is the path string
PathCompactPath(hDC, maxPath, rect.Width());
still its truncate last two three character from maxPath after set onto static text control.
when we set rect.right -= 15; it will display properly.
i dont know the reason behind it, can ou please specify this reason?
why this thing is happens?
Thanks in advance.
rakesh
|
|
|
|
|
Try using NormalizeRect .
ie.e
pWidthWnd->GetClientRect(&rect);
rect.NormalizeRect();
PathCompactPath(hDC, maxPath, rect.Width());
|
|
|
|
|
I have tried NormalizeRect() on rect object still it cuts.
can i have another function same as this one properly adjust this width and our text width that needs to display.
thanks
rakesh
|
|
|
|
|
I re-read your orginal post. It says still its truncate last two three character from maxPath after set onto static text control .
This is how PathCompactPath is expected to work, isn't it ?
|
|
|
|
|
no - no PathCompactPath is working properly,
but when we are display this text onto static control then it wont display full text it cuts last two three character.
but it display string properly at the debug time in CString object.
any specific reason behind it?
i am not resizing the static control even too.
thanks
rakesh
|
|
|
|
|
prasad_som wrote: Try using NormalizeRect.
Why would you suggest that? Are negative numbers even a possibility?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
dont set rect.right this way rect.right -= 15;
Set it using CRect::SetRect()
|
|
|
|
|
Ranjoy Guha wrote: dont set rect.right this way rect.right -= 15;
Set it using CRect::SetRect()
This has nothing to do with the problem as the right edge is being shrunk by 15 using either method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Where is the HDC coming from? You should be passing in an HDC that is associated with the control that you are setting the path into (the static control), not the parent window of the static control.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
The code you have is correct. Just ensure that pWidthWnd and hDC refer to the same control.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
I am working with splitter windows.My requirement is I need to do certain tasks when I adjust(move) the splitters.Is there any event that gets triggered when I adjust the splitters or is there any other approach to do this?
Thanks in advance.
Taruni
|
|
|
|