Click here to Skip to main content
16,005,060 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to compel the user Pin
Ray Cassick8-Jul-04 19:31
Ray Cassick8-Jul-04 19:31 
GeneralRe: How to compel the user Pin
sachinkalse8-Jul-04 20:16
sachinkalse8-Jul-04 20:16 
GeneralRe: How to compel the user Pin
Heath Stewart8-Jul-04 19:59
protectorHeath Stewart8-Jul-04 19:59 
GeneralRe: How to compel the user Pin
sachinkalse8-Jul-04 21:03
sachinkalse8-Jul-04 21:03 
GeneralRe: How to compel the user Pin
Heath Stewart9-Jul-04 2:57
protectorHeath Stewart9-Jul-04 2:57 
GeneralRe: How to compel the user Pin
sachinkalse11-Jul-04 22:10
sachinkalse11-Jul-04 22:10 
Generalprinting document using threads Pin
blankg8-Jul-04 14:15
blankg8-Jul-04 14:15 
GeneralChild Control Painting problem Pin
Jon_Slaughter8-Jul-04 13:16
Jon_Slaughter8-Jul-04 13:16 
I'm trying to create a user control from the Button class, the problem is, is if I completely remove the code to do any drawing on the form and on the control(having empty onpaint and onpaintbackground methods in both), the control's client area is painted black... the problem is I am making a control that will use an alpha bitmap... and I have no idea why the form or control is doing this. I've looked at all the members of the class and tried to find something that would turn it off, but it doesn't... its very annoying :/ Anyways, heres the same code that demonstrates the problem for me:


[Form1.cs]
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication1
{

public class Form1 : System.Windows.Forms.Form
{

private System.ComponentModel.Container components = null;
private jButton jButton1 = new jButton();

public Form1()
{
this.jButton1.Location = new System.Drawing.Point(304, 216);
this.jButton1.Name = "jButton1";
this.jButton1.Size = new System.Drawing.Size(192, 176);
this.jButton1.TabIndex = 0;
this.jButton1.Text = "Blah Blah";
this.Controls.Add(this.jButton1);
}



[STAThread]
static void Main() { Application.Run(new Form1()); }

protected override void OnPaint(PaintEventArgs e) { }
protected override void OnPaintBackground(PaintEventArgs pevent) { }

} }



[jButton.cs]
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace WindowsApplication1
{

public class jButton : System.Windows.Forms.Button
{

public jButton() { }

protected override void OnPaint(PaintEventArgs e) { }
protected override void OnPaintBackground(PaintEventArgs pevent) { }

}
}


basically when I run this, I get a black box where the button is suppose to be.
GeneralRe: Child Control Painting problem Pin
Jon_Slaughter8-Jul-04 13:26
Jon_Slaughter8-Jul-04 13:26 
GeneralPostMessage Pin
kobybr8-Jul-04 11:38
kobybr8-Jul-04 11:38 
GeneralRe: PostMessage Pin
Serge Lobko-Lobanovsky9-Jul-04 3:44
Serge Lobko-Lobanovsky9-Jul-04 3:44 
GeneralRe: PostMessage Pin
kobybr9-Jul-04 8:56
kobybr9-Jul-04 8:56 
Questiondsoframer disables plugins?? Pin
Asad Hussain8-Jul-04 11:00
Asad Hussain8-Jul-04 11:00 
GeneralCopy from Excel and paste on DataGrid Pin
Ruchi Gupta8-Jul-04 10:54
Ruchi Gupta8-Jul-04 10:54 
GeneralRe: Copy from Excel and paste on DataGrid Pin
Nick Parker8-Jul-04 11:30
protectorNick Parker8-Jul-04 11:30 
GeneralRe: Copy from Excel and paste on DataGrid Pin
Heath Stewart8-Jul-04 12:10
protectorHeath Stewart8-Jul-04 12:10 
GeneralRepainting window. Pin
Nick Z.8-Jul-04 9:59
Nick Z.8-Jul-04 9:59 
GeneralRe: Repainting window. Pin
Heath Stewart8-Jul-04 11:24
protectorHeath Stewart8-Jul-04 11:24 
GeneralRe: Repainting window. Pin
Nick Z.8-Jul-04 15:24
Nick Z.8-Jul-04 15:24 
GeneralRe: Repainting window. Pin
Heath Stewart8-Jul-04 16:34
protectorHeath Stewart8-Jul-04 16:34 
GeneralRe: Repainting window. Pin
Nick Z.8-Jul-04 15:43
Nick Z.8-Jul-04 15:43 
GeneralRe: Repainting window. Pin
Nick Z.8-Jul-04 16:21
Nick Z.8-Jul-04 16:21 
GeneralRe: Repainting window. Pin
Heath Stewart8-Jul-04 16:38
protectorHeath Stewart8-Jul-04 16:38 
GeneralRe: Repainting window. Pin
Nick Z.8-Jul-04 17:00
Nick Z.8-Jul-04 17:00 
GeneralRe: Repainting window. Pin
Heath Stewart8-Jul-04 17:08
protectorHeath Stewart8-Jul-04 17:08 

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.