Click here to Skip to main content
15,914,331 members
Home / Discussions / C#
   

C#

 
QuestionWorking with Crystal Reports and Forms Pin
sorooshk8-Jan-10 21:40
sorooshk8-Jan-10 21:40 
AnswerRe: Working with Crystal Reports and Forms Pin
Saksida Bojan8-Jan-10 22:03
Saksida Bojan8-Jan-10 22:03 
GeneralRe: Working with Crystal Reports and Forms Pin
sorooshk8-Jan-10 22:16
sorooshk8-Jan-10 22:16 
AnswerRe: Working with Crystal Reports and Forms Pin
Said Ali Jalali9-Jan-10 2:34
Said Ali Jalali9-Jan-10 2:34 
GeneralRe: Working with Crystal Reports and Forms Pin
Saksida Bojan9-Jan-10 3:11
Saksida Bojan9-Jan-10 3:11 
QuestionHow to retrieve username from event Log in C#? Pin
Sunil G8-Jan-10 19:10
Sunil G8-Jan-10 19:10 
AnswerRe: How to retrieve username from event Log in C#? Pin
Eddy Vluggen9-Jan-10 1:20
professionalEddy Vluggen9-Jan-10 1:20 
QuestionForm With Shadow Pin
roshihans8-Jan-10 16:35
roshihans8-Jan-10 16:35 
I have a form and a png image file (with a transparent shadow in its border) and what I want is to make a drop shadow effect on the form. I know there are CS_DROPSHADOW solution for this, but I think it doesn't look too good. So I create a "fake" form using CreateWindowEx (via DllImport), and draw the png image file into the fake form.

void CreateFakeForm()
{
            WNDCLASSEX wndClsEx = new WNDCLASSEX();
            wndClsEx.Init();
            wndClsEx.style = CS_VREDRAW | CS_HREDRAW;
            wndClsEx.lpfnWndProc = m_DefWndProcDelegate;
            wndClsEx.cbClsExtra = 0;
            wndClsEx.cbWndExtra = 0;
            wndClsEx.hInstance = GetModuleHandle(null);
            wndClsEx.hIcon = IntPtr.Zero;
            wndClsEx.hIconSm = IntPtr.Zero;
            wndClsEx.hCursor = IntPtr.Zero;
            wndClsEx.hbrBackground = IntPtr.Zero;
            wndClsEx.lpszClassName = m_WndClsName;
            wndClsEx.lpszMenuName = null;

            bool success = RegisterClassEx(ref wndClsEx) != 0;

            UInt32 dwExStyle = WS_EX_LAYERED |
                WS_EX_TRANSPARENT |
                WS_EX_NOACTIVATE |
                WS_EX_LEFT;
            UInt32 dwStyle = WS_VISIBLE | WS_OVERLAPPED;
            
            FakeWndHandle = CreateWindowEx(dwExStyle
                , m_WndClsName
                , null
                , dwStyle
                , X
                , Y
                , PngImg.Width
                , PngImg.Height
                , MainFormHandle
                , IntPtr.Zero
                , GetModuleHandle(null)
                , IntPtr.Zero
                );
}


The problem is my fake form always in the topmost position. Is there a way to put the fake form behind the main form?
In other words, how do I set z-order between the main form and the fake form so that the fake form placed at the bottom of the Z order?

How to hide the fake form whenever the main form minimized or maximized, and move or resize the fake form whenever the main form moved or resized?

Thanks.
AnswerRe: Form With Shadow Pin
Saksida Bojan8-Jan-10 19:06
Saksida Bojan8-Jan-10 19:06 
GeneralRe: Form With Shadow Pin
roshihans8-Jan-10 19:59
roshihans8-Jan-10 19:59 
GeneralRe: Form With Shadow Pin
Saksida Bojan8-Jan-10 20:21
Saksida Bojan8-Jan-10 20:21 
GeneralRe: Form With Shadow Pin
roshihans8-Jan-10 22:42
roshihans8-Jan-10 22:42 
GeneralRe: Form With Shadow Pin
Saksida Bojan8-Jan-10 22:46
Saksida Bojan8-Jan-10 22:46 
GeneralRe: Form With Shadow Pin
roshihans9-Jan-10 1:43
roshihans9-Jan-10 1:43 
GeneralRe: Form With Shadow Pin
Saksida Bojan9-Jan-10 1:58
Saksida Bojan9-Jan-10 1:58 
GeneralRe: Form With Shadow Pin
roshihans9-Jan-10 5:00
roshihans9-Jan-10 5:00 
GeneralRe: Form With Shadow Pin
roshihans9-Jan-10 16:04
roshihans9-Jan-10 16:04 
GeneralRe: Form With Shadow Pin
Saksida Bojan9-Jan-10 22:12
Saksida Bojan9-Jan-10 22:12 
AnswerRe: Form With Shadow Pin
So Sereyboth29-Mar-11 23:16
So Sereyboth29-Mar-11 23:16 
QuestionI have another problem :( [modified] Pin
Raztor08-Jan-10 16:30
Raztor08-Jan-10 16:30 
AnswerRe: I have another problem :( Pin
Luc Pattyn8-Jan-10 16:50
sitebuilderLuc Pattyn8-Jan-10 16:50 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:05
Raztor08-Jan-10 17:05 
AnswerRe: I have another problem :( Pin
Abhinav S8-Jan-10 16:55
Abhinav S8-Jan-10 16:55 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:04
Raztor08-Jan-10 17:04 
GeneralRe: I have another problem :( Pin
Abhinav S8-Jan-10 17:09
Abhinav S8-Jan-10 17:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.