Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Permanent Line on form Pin
Arjan Einbu17-Sep-03 21:07
Arjan Einbu17-Sep-03 21:07 
GeneralTyped Dataset default value Pin
mthead17-Sep-03 9:29
mthead17-Sep-03 9:29 
GeneralSerializing objects. Pin
kalla17-Sep-03 9:21
kalla17-Sep-03 9:21 
GeneralRe: Serializing objects. Pin
rak17-Sep-03 20:24
rak17-Sep-03 20:24 
GeneralRe: Serializing objects. Pin
kalla12318-Sep-03 5:39
kalla12318-Sep-03 5:39 
GeneralDIB Sections and Pixel Formats in C# Pin
Dave Kerr17-Sep-03 8:01
Dave Kerr17-Sep-03 8:01 
GeneralCustom Control OnPaint() Problem Pin
Douglas Troy17-Sep-03 6:35
Douglas Troy17-Sep-03 6:35 
GeneralRe: Custom Control OnPaint() Problem(Modified) Pin
Mazdak17-Sep-03 7:48
Mazdak17-Sep-03 7:48 
I haven't done this before but maybe I can show you some point:

As I rememeber,I sets those styles in constructor of class after InitializeComponent().

There is an article in CP by Jibin Pan which create custom shapes for Form which title "Interactive Shaped Forms" in C# section .I don't have the link now but I copy/paste from it here,I guess the scenario is the same for UserControl too:


Create a form with some background color, then set the property TransparenceKey to that color and set the FormBorderStyle to None. You have to set these in the constructor of your UserControl

Override the Form_Paint function You can do it by

protected override void OnPaint(PaintEventArgs e)

or add a new Handler

this.Paint += new System.Windows.Form.PaintEventHandler(Form_Paint)

Using Region and GraphicsPath to set the Region that you want to display. im = new Bitmap("mediaPlayer.jpg");

private void Form_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;

Rectangle mainRect = new Rectangle(0, 0, 695, 278);

Region mainRegion = new Region(mainRect);

e.Graphics.SetClip(mainRegion, CombineMode.Replace);

// Create a GraphicsPath object and add a curve.
GraphicsPath myPath = new GraphicsPath();

...

Region ExcludeRegion3 = new Region(myPath);

e.Graphics.ExcludeClip(ExcludeRegion3);

...

e.Graphics.DrawImage(im, 0, 0, 495,278);

// Reset clipping region to infinite.
e.Graphics.ResetClip();
}




I don't know if you do the same in your pani event handler. Hope it helps.

Mazy

No sig. available now.

GeneralRe: Custom Control OnPaint() Problem(Modified) Pin
Douglas Troy17-Sep-03 8:51
Douglas Troy17-Sep-03 8:51 
GeneralSMS via UCP in C# Pin
User 31295917-Sep-03 5:24
User 31295917-Sep-03 5:24 
GeneralSetting Left Margin when printing... Pin
.gonad17-Sep-03 5:04
.gonad17-Sep-03 5:04 
GeneralRe: Setting Left Margin when printing... Pin
.gonad17-Sep-03 5:34
.gonad17-Sep-03 5:34 
QuestionHow to implement a simply textcontrol in a picturebox? Pin
kfowlks17-Sep-03 4:48
kfowlks17-Sep-03 4:48 
Generalpackage and deployment related question Pin
Tridip Bhattacharjee17-Sep-03 4:26
professionalTridip Bhattacharjee17-Sep-03 4:26 
GeneralRe: package and deployment related question Pin
Arun Bhalla18-Sep-03 7:19
Arun Bhalla18-Sep-03 7:19 
GeneralRe: package and deployment related question Pin
sumeat18-Sep-03 15:24
sumeat18-Sep-03 15:24 
GeneralRe: package and deployment related question Pin
Braulio Dez19-Sep-03 2:19
Braulio Dez19-Sep-03 2:19 
Questionhow to loop in control collection?? Pin
Tridip Bhattacharjee17-Sep-03 4:13
professionalTridip Bhattacharjee17-Sep-03 4:13 
AnswerRe: how to loop in control collection?? Pin
Mazdak17-Sep-03 7:53
Mazdak17-Sep-03 7:53 
Questionhow to handle click event for a multiple button ?? Pin
Tridip Bhattacharjee17-Sep-03 4:00
professionalTridip Bhattacharjee17-Sep-03 4:00 
AnswerRe: how to handle click event for a multiple button ?? Pin
MrEyes17-Sep-03 4:28
MrEyes17-Sep-03 4:28 
GeneralWhy disable debug Pin
Old Gun17-Sep-03 3:37
Old Gun17-Sep-03 3:37 
Generalinterop struct types Pin
Tym!17-Sep-03 2:59
Tym!17-Sep-03 2:59 
GeneralMarshaling Structs Reference Pin
Tym!17-Sep-03 4:26
Tym!17-Sep-03 4:26 
GeneralEditable ListView items Pin
Rickard Andersson2017-Sep-03 1:28
Rickard Andersson2017-Sep-03 1: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.