 |
|
 |
First of all thanks for code. its very useful.
I used CStaticTrans but when rewrite on static cntrl letters are become unreadable.they drawed on olds. can you help me
modified 2 Dec '11.
|
|
|
|
 |
|
|
 |
|
 |
when create a new project, if you choose "Common Control manifest" option in wizard, you will find your edit control's background will be drawn as pure black instead of transparent. After remove this option ,everything works fine. Great thanks.
|
|
|
|
 |
|
 |
I made this change in my existing dialog project by opening stdafx.h and commenting out the 9 lines at the end that mention Microsoft.Windows.Common-Controls.
|
|
|
|
 |
|
 |
I use this code:
case WM_CTLCOLOREDIT:
{
HDC hdcEdit = (HDC)wParam; //Get handle
SetBkMode(hdcEdit, TRANSPARENT); // EditBox Background Mode (note: OPAQUE can be used)
SetTextColor(hdcEdit,(COLORREF)m_clrFore);
if (!l_brush){
l_brush = (HBRUSH)GetStockObject(HOLLOW_BRUSH);
}
return (long)l_brush;
}
It works fine with multiline editcontrols. However a single line editcontrol becomes black on Windows XP pro
Help is much appreciated
Jasper
|
|
|
|
 |
|
 |
I tried to write code like you. and everything is working fine except one problem. In my application I am displaying a bitmap on a dialog and showing text on them. I have shown the text on transparent static controls as per your way. The text (Static control) can also be moved with the help of mouse. The problem is that when I partially place one static control over other, the topmost control displays the background image in the transparent area. Actually it should show the text of the static control which is below it and not the bitmap of the background. Can you please help me in this matter.
Tushar S. Jadhav
Nothing is IMPOSSIBLE. Even the word IMPOSSIBLE says I-M-POSSIBLE.
|
|
|
|
 |
|
 |
If an user writes more simbols than the CEdit length, we see a dirt.
Please, help to fix it!
|
|
|
|
 |
|
 |
The problem with the dirt appears only when you select some part of the text and then you try to extend your selection to text that doesn' fit in the EditBox (in other words, when the text is scrolled).
Also there is another bug: let's say we have the following text:
123456. Select 456 from left to right, don't release the mouse button and select 123. You will se that 123456 is selected, instead of 123!
Here's a workaround:
add OnMouseMove message handler for the EditBox, and put there the following code:
void CEditTrans::OnMouseMove(UINT nFlags, CPoint point)
{
if(nFlags & MK_LBUTTON)
{
UpdateCtrl();
}
CEdit::OnMouseMove(nFlags, point);
}
there will be a small flickering, but the 2 bugs are solved!
|
|
|
|
 |
|
 |
A sile code to change the font on the Edit box
CEdit m_edit;
CFont font;
font.CreatePointFont(180, ("Arial"));
m_edit.SetFont(&font);
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
 |
|
 |
Hello
In a MULTI LINE Edit control, the first line is GREY, never mind what I set the bg colour to - the first line is still GREY
Any idea why?
Thanks
Alex
|
|
|
|
 |
|
 |
Hello,
Is there a window setting to center the text vertically in edit box?
it can be done horizontally but I could find anything to do it vertically.
thanks
|
|
|
|
 |
|
 |
Why not replacing this code: GetWindowRect(rect);
pParent->ScreenToClient(rect);
rect.DeflateRect(2, 2);with a simpler (and more correct for border style): GetClientRect(rect); ?
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
I think it's not the same thing.
call GetClientRec(&rect).the reference point of variable rect is the origin point of the client area of Edit control.
pParent->InvalidateRect(rect, TRUE);
this code wants the reference point to be that of the parent dialog.
|
|
|
|
 |
|
 |
Right. Probably I didn't see the line below.
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
Can anyone apply this to Multi-line Edit or ListBox controls? I have tried to make a multi-edit control out of the edit control in the demo; however, text will not wrap and turns to jiberish when you run out of room in the control. I have a application with Multi-line edit controls as well as ListBox controls and need to have them transparent so they can bleed through to a bitmap underneath.
|
|
|
|
 |
|
 |
you have code in a headerfile . ..
that is the worst codingcrime there is .. stop doing that ..
|
|
|
|
 |
|
|
 |
|
 |
To each his own I alway say. I didn't see any code posted for "Skizmo". Perhaps you should post some code of your own for us to uselessly tear apart before being overly critical of others who do post their code. Thanks for posting the code Dany.
|
|
|
|
 |
|
 |
Perfectly "legal" to inline a function in the header. Doing so can improve performance, but at the expense of someone else being able to see the source code. This is assuming that the source code is not available to the user, such as a library.
Manufacturing Software Developer
Hewlett-Packard Company
|
|
|
|
 |
|
 |
type some words in edit control and then select the words from one side to another, do not set your hand free, and let the cursor back, you may find that the words selected turn black.
|
|
|
|
 |
|
 |
Hi,I solve this problem by changing the last line of
void CEditTrans::UpdateCtrl()
{
CWnd* pParent = GetParent();
CRect rect;
GetWindowRect(rect);
pParent->ScreenToClient(rect);
rect.DeflateRect(2, 2);
pParent->InvalidateRect(rect, FALSE);
}
with
pParent->InvalidateRect(rect, TRUE);//Redraw the background
And also add OnKeyUp() message handler.
|
|
|
|
 |
|
 |
this doesn't work on Windows2000 Server Familiy
|
|
|
|
 |
|
 |
hey~
static control works good , but edit control doesn't work on window xp
|
|
|
|
 |
|
 |
Tested on all version of Windows and work A1!
|
|
|
|
 |
|
 |
Edit control doesn't work on XP Pro.
|
|
|
|
 |