|
Hi,
I have a Custom ListCtrl in my application. I have to resize this listCtrl as and when the Size of the View changes. A tried a lot but the only this i am able to do is To change the ColumnWidth of Header Tabs acc. to the Size of the View.
Plz help me out......
Vinod C S
|
|
|
|
|
vinivc wrote: I have a Custom ListCtrl in my application. I have to resize this listCtrl as and when the Size of the View changes. A tried a lot but the only this i am able to do is To change the ColumnWidth of Header Tabs acc. to the Size of the View.
Plz help me out......
See the following link
http://www.codeproject.com/listctrl/xlistctrl.asp
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
try this
LVCOLUMN stColumn = { 0 };
stColumn.mask = LVCF_WIDTH;
stColumn.cx = 100/ the widht u required
m_List.SetColumn( nColumnnNumber, &stColumn );
nave
|
|
|
|
|
Naveen R wrote: try thisLVCOLUMN stColumn = { 0 };stColumn.mask = LVCF_WIDTH;stColumn.cx = 100/ the widht u requiredm_List.SetColumn( nColumnnNumber, &stColumn );
How can we Increase or decrease the Size of listctrl by using it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
only size the header ctrl
nave
|
|
|
|
|
Naveen R wrote: only size the header ctrl
Sorry to be sound rude.I believe that is not the question?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
vinivc wrote: have a Custom ListCtrl in my application. I have to resize this listCtrl as and when the Size of the View changes. A tried a lot but the only this i am able to do is To change the ColumnWidth of Header Tabs acc. to the Size of the View.
Handle WM_SIZE message in View and use SetWindowPos or MoveWindow api to change size of the ListCtrl accordingly.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
the following is the code I found in MSDN.
Anybody can explain about the hatchbits? I didnt get anything from the code.
See the code below
// Create a hatched bit pattern.
WORD HatchBits[8] = { 0x11, 0x22, 0x44, 0x88, 0x11,
0x22, 0x44, 0x88 };
// Use the bit pattern to create a bitmap.
CBitmap bm;
bm.CreateBitmap(8,8,1,1, HatchBits);
// Create a pattern brush from the bitmap.
CBrush brush;
brush.CreatePatternBrush(&bm);
// Select the brush into a device context, and draw.
CBrush* pOldBrush = (CBrush*)pDC->SelectObject(&brush);
pDC->RoundRect(CRect(50, 50, 200, 200), CPoint(10,10));
// Restore the original brush.
pDC->SelectObject(pOldBrush);
SaRath
|
|
|
|
|
SaRath bm.CreateBitmap(8,8,1,1, HatchBits);
You are creating an 8x8 pixel monochrome bitmap. In the supplied bits array a bit of 0 will be black and a bit of 1 will be white. As a byte is 8 bits, you need 8 bytes to get the required number of bits for the bitmap (8x8).
So what you have is:
BYTE Bits Colours
0x88 10001000 |* * |
0x44 01000100 | * * |
0x22 00100010 | * * |
0x11 00010001 | * *|
0x88 10001000 |* * |
0x44 01000100 | * * |
0x22 00100010 | * * |
0x11 00010001 | * *| which is a bit-pattern bitmap.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
thanks for your reply.
I saw a nice article regarding this.
http://www.codeproject.com/gdi/custom_pattern_brush.asp
Once again thanks for ur reply
SaRath
|
|
|
|
|
Hi,
My Application is Dialoged based Application
My application will be launched by another application using ShellExecute().
As it will start running it will have no user interaction that means user will manualy not trigger any event like clicking on button or so.
My application will display only data in some listbox or in MultiEdit box countiniously. ( basicaly its purpose is to show data/results)
As the dialog will cross OnInitDialog then it will wait for user's interaction , but in my application user has no interaction.
Can I handle this all in OnInitDialog() before returning of this method. Is it a right approach
OR Is there any other way to handle it .
thanks
Regards.
|
|
|
|
|
zahid_ash wrote: As it will start running it will have no user interaction that means user will manualy not trigger any event like clicking on button or so.
I think this will solve by setting the Dialog Style as 'Disabled'
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Would the setting to Disable will run the calculation menthods by itself,
I think I have to call them some where in the application,
Regards.
|
|
|
|
|
zahid_ash wrote: Would the setting to Disable will run the calculation menthods by itself
Have you tried that?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Yes I have tried, The disabled property not allows the user to interact with mouse.
but how can i run my caluclation methods now that will show result in the controls
Regards.
|
|
|
|
|
zahid_ash wrote: ut how can i run my caluclation methods now that will show result in the controls
Via Window Message!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
zahid_ash wrote: As the dialog will cross OnInitDialog then it will wait for user's interaction , but in my application user has no interaction.
Can I handle this all in OnInitDialog() before returning of this method. Is it a right approach
OR Is there any other way to handle it .
Very bad. A particular function is made for a purpose and let it be for that only.
What you can do is create a callback function for your application which will be a member function of this dialog. Whenever you wish to update call this function from the application that triggers this dialog.
Nibu thomas
Software Developer
Programming Tips[^]
|
|
|
|
|
What is the right way to right the callback ,
and how can I call it from that application , that application is written in Visual Basic 6.
Regards.
|
|
|
|
|
zahid_ash wrote: and how can I call it from that application , that application is written in Visual Basic 6.
A more appropriate place would be VB forums, since they would be knowing more on this subject.
Nibu thomas
Software Developer
Programming Tips[^]
|
|
|
|
|
zahid_ash wrote: My application will display only data in some listbox or in MultiEdit box countiniously
Sounds like you want something running on a timer. In OnInitDialog call SetTimer(), then do the updating of the list box in your OnTimer() handler.
Your dialog will not be displayed until after the OnInitDialog function has exited, so doing any of this processing there will not work.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Seems correct to me
If i call the SetTimer() and in Ontimer Event i will call the method the kill the timer.
would that method continue till its end even the timer has been killed .
Regards.
|
|
|
|
|
zahid_ash wrote: would that method continue till its end even the timer has been killed
Nope!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi
I want to get the following details of my system in VC.
1)Processor config(eg:233 Mhz)
2)RAM size
3)Display Adapter
4)Monitor Resolution
5)CDROM Drive,Keyboard,Network Card etc
I need this details on Win XP & Win 2000.
Which API gives list of all these details including RAM Size??
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
QuickDeveloper wrote: hi
I want to get the following details of my system in VC.
1)Processor config(eg:233 Mhz)
2)RAM size
3)Display Adapter
4)Monitor Resolution
5)CDROM Drive,Keyboard,Network Card etc
I need this details on Win XP & Win 2000.
Which API gives list of all these details including RAM Size??
For Monitor resolution use GetSystemMetrics .
For Memory use GetMemoryStatus .
For Processor use GetSystemInfo .
Well the only complete answer for all of them is WMI . WMI gives in depth details for each of them.
Nibu thomas
Software Developer
Programming Tips[^]
|
|
|
|
|
Nibu thomas wrote: WMI gives in depth details for each of them
could you give me some links or Sample Code which uses WMI..
Thanx for the reply
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|