- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I want to display text in a text box in Red if it is over a certain value, otherwise display it in Black.
My text box is disabled (i.e. display only).
Searching the forum I found the suggestion of using SetTextColor.
Is this correct, and how would I use it.
Below is an example - but doesn't work. Thanks
write (C11,'(F10.3,A)') d,char(0)
cr=SetTextColor(hDC,RGB(0,256,255))
iret=SetDlgItemText(hwnd,IDC_HEIGHTD,c11)
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
You can create a "text box" in different ways. From your example, it looks like you want a true "windows" text box of the form that woks in a windows dialog box. A second way is to do all the programming yourself, within the Fortran program. Using Quickwin, this second method is pretty easy. That would involve the Fortran call SetTextColor, which effects the text color within a "text window" which is another Quickwin concept.I do this quite often.
But if you want a true Windows dialog text box--well, I hope there is someone else here that can help. I suspect that SetTextColor is incompatible with the windows dialog process.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Try topic http://software.intel.com/en-us/forums/topic/301886 there are various others on the forum if you search.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Thanks, I do want a true Windows dialog text box.
I had found that topic previously when searching - but it makes me realise that my knowledge is limited. I've never (to my knowledge) done subclassing before and not sure where the example code fits into my code.
I have:
iret = DialogBox(hInst,MAKEINTRESOURCE(IDD_MEAN2PTS),hWndMain,LOC(Mean2PtsProc))
which calls:
integer*4 function Mean2PtsProc(hwnd, message, wParam, lParam)
then there is:
select case (message)
case (WM_HELP)
call help
case (WM_INITDIALOG)
Mean2PtsProc=1
h_Write=GetDlgItem(hWnd,IDC_WRITE)
return
case (WM_SHOWWINDOW)
etc...
I'm not sure when hOldProc=SetWindowLong(dlg%hWnd, GWL_WNDPROC, LOC(ColorDlgProc)
fits in with my code.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I solved the problem using Anthony Richard's example. It gives black text on a red background.
I hope to be able to modify it to give red text on a white background - I don't know if that is possible.
http://software.intel.com/en-us/articles/how-to-customize-dialog-box-colors-using-subclassing/
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
As the joint author (with Steve Lionel) I note that the figures included in the article annoyingly fail to display when browsing the article using FireFox.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Nor does it show in Exploder 11 or Chrome.
Neels
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Ok - should be fixed now. I also changed the link for Xeffort to point to the new site.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Weird - it was showing for me earlier. I'll fix it on Monday, but that particular image is not all that useful.
