|
Depends what you mean by read-only. If you want the user to select from the drop-down list but not enter anything that is not on the list, then set the ComboBox style to CBS_DROPDOWNLIST (That's the name in winuser.h - your framework may have a different name).
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
What do you mean with "read only combobox"?
If you mean a combobox whose content cannot be changed by the user, simply disable it (it becames grayed, but there is not other way, however you can make it ownerdrawn and draw it with normal colors either if it is disabled).
If you mean a combobox where the user cannot type characters, but only select from a pre-defined list, use the CBS_DROPDOWNLIST style.
|
|
|
|
|
Hello . I have an MDI application with CView based on CScrollView and somewhere , in OnMouseMove handler I have :
if(pView->GetStyle() & WS_HSCROLL)TRACE("\n WS_HSCROLL \n");
if(pView->GetStyle() & WS_VSCROLL)TRACE("\n WS_VSCROLL \n");
without any effect ... either scrollbar appear or not , I haven't anything ... how can I know for sure of scrollbar appear or not ?
Thanks !
|
|
|
|
|
Have you called SetScrollSizes()[^] in your OnInitialUpdate() method?
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Yes , everything it's allright there ... sometime scrollbar appear , sometime not ... I mean , if the window is reduced , scrollbar appear , if window is increased , scrollbar dissapear .
|
|
|
|
|
That sounds like correct behaviour. The scrollbar should only appear when the amount of data to display is larger than the client area of the window, either horizontally, vertically, or both. Are you sure that you are recalculating your scroll sizes correctly when the window size changes?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Yes , I'm sure . Still , I can't solve the problem ... I see that VC2005 have CheckScrollBars(...) method , but I work in VC6 ...
|
|
|
|
|
Can GetScrollBarInfo[^] give you the required information?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
I didn't use GetScrollBarInfo by now ... I don't know how ... I will try and let you know if I did it .
|
|
|
|
|
All right, good luck, if you get stuck somewhere, tell me/us and we'll see if i/we can help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
I solve the problem in that way : I write myself CheckScrollBars(...) method :
void CMyView::CheckScrollBars(BOOL& bHasHorzBar, BOOL& bHasVertBar) const
{
DWORD dwStyle = GetStyle();
CScrollBar* pBar = GetScrollBarCtrl(SB_VERT);
bHasVertBar = ((pBar != NULL) && pBar->IsWindowEnabled()) || (dwStyle & WS_VSCROLL);
pBar = GetScrollBarCtrl(SB_HORZ);
bHasHorzBar = ((pBar != NULL) && pBar->IsWindowEnabled()) || (dwStyle & WS_HSCROLL);
}
|
|
|
|
|
If it works for you, then , thanks for sharing your solution.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
I have following problem :
I have condition and in netbeans its saying : warning: assignment makes integer from pointer without a cast
if (var==varb+c) {
sbod='b';}
here is declaration :
char sbod;
float var,varb,c;
any idea what might be worng with my condition ?
|
|
|
|
|
I did not understand your problem but as a general note, you must never directly compare floating point values. You will be surprised that it doesn't always work out and lead to subtle bugs. Google about comparing float values in C to find out more.
|
|
|
|
|
ok so is there any way how can I compare two variables which are float , int or other type ?
|
|
|
|
|
|
Something strange about that message, although I guess you are getting an automatic cast from char to int .
As mentioned in the previous answer, don't use == expressions to compare float values as they are always approximations, unless whole numbers, but even then you can lose precision with very large values.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Maybe Neatbeans is drunk or you reported the wrong piece of code, please check for both possibilities.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I have 4 modelless dialog in a view. Each dialog is having one button. If I click on button I need to display a dialog on the top but it should not be model dialog. So I used
::SetWindowPos(FirstDlg.GetSafeHwnd(),HWND_TOP,2,30,100,60,SWP_SHOWWINDOW ); But problem is:
This dilaog box is having edit control. I am not able to edit in edit control. I am not able to enter anything in edit control.
How to fix this issue.
|
|
|
|
|
Are you able to enter text in the edit box when the dialog is shown normal?
|
|
|
|
|
If I create dialog with
m_objGDDlg->Create( IDD_FORMVIEW, GetDesktopWindow());
I am not able to enter but If I create dialog with
m_objGDDlg->Create( IDD_FORMVIEW, this);
I am able to enter but some portion is overlapped with another dialog.
|
|
|
|
|
Do you have any hidden controls on the dialog?
|
|
|
|
|
|
Hi all,
please tell me what is the maximum number of threads that i use in my SDI type application.
its is safe to generate and handle this large number of threads in application,or there is any othre option to handle this.
i have an ListCtrl and this have hundred of items,i want to check all item at same time so i generate thread for each item, but some time there is execption occur when start or stop the thread.
please help me for this.
thanks in advance.
|
|
|
|
|
It is not a good idea to have a large number of threads.
You must instead have a fixed number of threads and make use of them for your processing.
As for your question on the maximum number of threads, read this blog entry -
Pushing the Limits of Windows: Processes and Threads[^]
|
|
|
|