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

C#

 
QuestionLoading vjslib dynamically Pin
Gareth H27-Jan-09 22:49
Gareth H27-Jan-09 22:49 
AnswerRe: Loading vjslib dynamically Pin
Karmendra Suthar27-Jan-09 23:34
Karmendra Suthar27-Jan-09 23:34 
GeneralRe: Loading vjslib dynamically Pin
Gareth H28-Jan-09 0:46
Gareth H28-Jan-09 0:46 
Question[Message Deleted] Pin
arkiboys27-Jan-09 22:29
arkiboys27-Jan-09 22:29 
AnswerRe: read xml contents Pin
N a v a n e e t h27-Jan-09 23:15
N a v a n e e t h27-Jan-09 23:15 
GeneralRe: read xml contents Pin
arkiboys27-Jan-09 23:46
arkiboys27-Jan-09 23:46 
AnswerRe: read xml contents Pin
Karmendra Suthar27-Jan-09 23:23
Karmendra Suthar27-Jan-09 23:23 
QuestionC# .NET Control Transparency Problem Pin
Hristiyan27-Jan-09 21:43
Hristiyan27-Jan-09 21:43 
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:
protected override  CreateParams CreateParams 
{ 
  get 
  { 
    CreateParams cp=base.CreateParams; 
    cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT 
    return cp; 
  } 
} 
protected override  void OnPaintBackground(PaintEventArgs pevent) 
{ 
  //do not allow the background to be painted  
}  


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 accross itself with a random color:
using System; 
using System.Collections.Generic; 
using System.Text; 
using System.Windows.Forms; 
using System.Drawing; 
namespace WindowsApplication16 
{ 
    public class HrisTranspControl : Control 
    { 
        private Pen _drawingPen; 
        public HrisTranspControl() 
        { 
            Random rnd = new Random(); 
            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); 
        } 
        protected override CreateParams CreateParams 
        { 
            get 
            { 
                CreateParams cp = base.CreateParams; 
                cp.ExStyle |= 0x00000020; 
                return cp; 
            } 
        } 
        protected override void OnPaintBackground(PaintEventArgs pevent) 
        { 
            // Do nothing 
        } 
        protected override void OnPaint(PaintEventArgs e) 
        { 
            base.OnPaint(e); 
            e.Graphics.DrawLine(_drawingPen, new System.Drawing.Point(0, 0), new System.Drawing.Point(this.Width, this.Height)); 
        } 
    } 
} 

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 !!!
http://xs135.xs.to/xs135/09015/z-order696.jpg.xs.jpg[^]
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" doesnt change the Z-ORDER
AnswerRe: C# .NET Control Transparency Problem Pin
Phil J Pearson28-Jan-09 3:59
Phil J Pearson28-Jan-09 3:59 
Questionget subreport of .rdl report Pin
bhaumikdv27-Jan-09 21:41
bhaumikdv27-Jan-09 21:41 
QuestionOracle/MySQL - byte[] and varbinary? Pin
devvvy27-Jan-09 21:39
devvvy27-Jan-09 21:39 
AnswerRe: Oracle/MySQL - byte[] and varbinary? Pin
Wendelius27-Jan-09 22:40
mentorWendelius27-Jan-09 22:40 
QuestionProgrammatic saving of an existing excel file Pin
Nikhil Wason27-Jan-09 21:06
Nikhil Wason27-Jan-09 21:06 
AnswerRe: Programmatic saving of an existing excel file Pin
MadArtSoft27-Jan-09 23:53
MadArtSoft27-Jan-09 23:53 
GeneralRe: Programmatic saving of an existing excel file Pin
Nikhil Wason28-Jan-09 0:14
Nikhil Wason28-Jan-09 0:14 
QuestionI want to get row index of datagridview Pin
M Riaz Bashir27-Jan-09 19:50
M Riaz Bashir27-Jan-09 19:50 
AnswerRe: I want to get row index of datagridview Pin
Wendelius27-Jan-09 20:38
mentorWendelius27-Jan-09 20:38 
AnswerRe: I want to get row index of datagridview Pin
MadArtSoft27-Jan-09 23:55
MadArtSoft27-Jan-09 23:55 
AnswerRe: I want to get row index of datagridview Pin
Wael Al Wirr29-Jan-09 2:09
Wael Al Wirr29-Jan-09 2:09 
QuestionHow can i Re-Draw UI control ? Pin
Yanshof27-Jan-09 18:52
Yanshof27-Jan-09 18:52 
AnswerRe: How can i Re-Draw UI control ? Pin
N a v a n e e t h27-Jan-09 19:00
N a v a n e e t h27-Jan-09 19:00 
AnswerRe: How can i Re-Draw UI control ? Pin
DaveyM6927-Jan-09 21:57
professionalDaveyM6927-Jan-09 21:57 
QuestionNetwork Programming Pin
M. J. Jaya Chitra27-Jan-09 16:49
M. J. Jaya Chitra27-Jan-09 16:49 
AnswerRe: Network Programming Pin
N a v a n e e t h27-Jan-09 18:28
N a v a n e e t h27-Jan-09 18:28 
AnswerRe: Network Programming Pin
Rutvik Dave29-Jan-09 8:36
professionalRutvik Dave29-Jan-09 8:36 

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.