Click here to Skip to main content
15,911,646 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is the return value of the insert and delete sql statement Pin
Palash Biswas3-Feb-10 17:21
Palash Biswas3-Feb-10 17:21 
GeneralRe: What is the return value of the insert and delete sql statement Pin
Zar Ni3-Feb-10 18:43
Zar Ni3-Feb-10 18:43 
GeneralRe: What is the return value of the insert and delete sql statement Pin
Palash Biswas3-Feb-10 19:54
Palash Biswas3-Feb-10 19:54 
GeneralRe: What is the return value of the insert and delete sql statement Pin
Zar Ni3-Feb-10 20:11
Zar Ni3-Feb-10 20:11 
GeneralRe: What is the return value of the insert and delete sql statement Pin
Zar Ni3-Feb-10 20:19
Zar Ni3-Feb-10 20:19 
GeneralRe: What is the return value of the insert and delete sql statement Pin
Palash Biswas3-Feb-10 20:27
Palash Biswas3-Feb-10 20:27 
GeneralRe: What is the return value of the insert and delete sql statement Pin
Zar Ni3-Feb-10 20:29
Zar Ni3-Feb-10 20:29 
Questiontransparent control and zorder problem Pin
fireghosthk3-Feb-10 16:38
fireghosthk3-Feb-10 16:38 
i did encounter the same problem as the guy have:
(from http://bytes.com/topic/c-sharp/answers/859828-c-transparent-control-problem)

Anybody can help?
thanks.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Hello there !

I'm developing a Windows appliciation that involves so called
"Transparent Controls". As you would probably know, the only ( as far
as i know ) way to achieve a fully transparent control in C# is to add
the so called "Transparent style" to your control
("WS_EX_TRANSPARENT"). There are numerous articles how to achieve this
and the method is ALMOST always one and the same:

1. protected override CreateParams CreateParams
2. {
3. get
4. {
5. CreateParams cp=base.CreateParams;
6. cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT
7. return cp;
8. }
9. }
10. protected override void OnPaintBackground(PaintEventArgs pevent)
11. {
12. //do not allow the background to be painted
13. }
14.


And that works fine! ( well .... at least all say that ..... and all
the articles say so ), but am i missing something or that method has
SOME SERIOUS problems that nobody can see ?

For example the Z-order. The following piece of code creates simply a
transparent control that draws a line across itself with a random
color:

1. using System;
2. using System.Collections.Generic;
3. using System.Text;
4. using System.Windows.Forms;
5. using System.Drawing;
6. namespace WindowsApplication16
7. {
8. public class HrisTranspControl : Control
9. {
10. private Pen _drawingPen;
11. public HrisTranspControl()
12. {
13. Random rnd = new Random();
14. this._drawingPen = new System.Drawing.Pen(new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(rnd.Next(0,255),rnd.Next(0,255), rnd.Next(0,255))),5);
15. }
16. protected override CreateParams CreateParams
17. {
18. get
19. {
20. CreateParams cp = base.CreateParams;
21. cp.ExStyle |= 0x00000020;
22. return cp;
23. }
24. }
25. protected override void OnPaintBackground(PaintEventArgs pevent)
26. {
27. // Do nothing
28. }
29. protected override void OnPaint(PaintEventArgs e)
30. {
31. base.OnPaint(e);
32. e.Graphics.DrawLine(_drawingPen, new System.Drawing.Point(0, 0), new System.Drawing.Point(this.Width, this.Height));
33. }
34. }
35. }


And so ... when u put few "line controls" on top of each other the
Z-ORDER goes to hell. You can't change it, its not corrent and it
changes randomly each time u select a random "line control".

I've tried A LOT of methods to fix that ( changing the z-order in
background, repainting the actual background because i think its
because the background is not drawn ... and so on ). None works. I'm
out of ideas and the worst part is i've almost finished the application
and right in the end i realize that bug and it kills me.

Please help !!!





The "line controls" were added in the order shows 1,2,3 , but the
Z-order appears to be different ( 1,3,2 ). In the current case "bring
to front" , "send to back" doesn't change the Z-ORDER

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
QuestionAdd months and set the last day of the month in one step Pin
sri_34643-Feb-10 15:22
sri_34643-Feb-10 15:22 
AnswerRe: Add months and set the last day of the month in one step [modified] Pin
Luc Pattyn3-Feb-10 15:39
sitebuilderLuc Pattyn3-Feb-10 15:39 
GeneralRe: Add months and set the last day of the month in one step Pin
sri_34643-Feb-10 16:50
sri_34643-Feb-10 16:50 
GeneralRe: Add months and set the last day of the month in one step Pin
Luc Pattyn3-Feb-10 17:01
sitebuilderLuc Pattyn3-Feb-10 17:01 
AnswerRe: Add months and set the last day of the month in one step Pin
Luc Pattyn3-Feb-10 16:11
sitebuilderLuc Pattyn3-Feb-10 16:11 
Questionrename listbox item Pin
kennyhibs3-Feb-10 12:40
kennyhibs3-Feb-10 12:40 
AnswerRe: rename listbox item Pin
Luc Pattyn3-Feb-10 12:57
sitebuilderLuc Pattyn3-Feb-10 12:57 
GeneralRe: rename listbox item Pin
kennyhibs3-Feb-10 18:21
kennyhibs3-Feb-10 18:21 
GeneralRe: rename listbox item Pin
Luc Pattyn3-Feb-10 23:58
sitebuilderLuc Pattyn3-Feb-10 23:58 
AnswerRe: rename listbox item Pin
ScottM13-Feb-10 21:25
ScottM13-Feb-10 21:25 
Questionmanaged code that will do the same as SetForegroundWindow Pin
kevinnicol3-Feb-10 8:10
kevinnicol3-Feb-10 8:10 
AnswerRe: managed code that will do the same as SetForegroundWindow Pin
DaveyM693-Feb-10 8:22
professionalDaveyM693-Feb-10 8:22 
GeneralRe: managed code that will do the same as SetForegroundWindow Pin
kevinnicol3-Feb-10 8:38
kevinnicol3-Feb-10 8:38 
QuestionMessage Removed Pin
3-Feb-10 7:08
attalurisubbu3-Feb-10 7:08 
AnswerRe: Need to display the page number as "2" from second page Onwards. Pin
Not Active3-Feb-10 7:37
mentorNot Active3-Feb-10 7:37 
Questiontrying to understand classes and threads using the progress bar in c# Pin
tonyonlinux3-Feb-10 6:15
tonyonlinux3-Feb-10 6:15 
AnswerRe: trying to understand classes and threads using the progress bar in c# Pin
Luc Pattyn3-Feb-10 6:28
sitebuilderLuc Pattyn3-Feb-10 6:28 

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.