Click here to Skip to main content
15,892,298 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionAvoiding circular reference? Pin
FruitBatInShades8-Sep-05 4:55
FruitBatInShades8-Sep-05 4:55 
AnswerRe: Avoiding circular reference? Pin
Stan Shannon9-Sep-05 17:34
Stan Shannon9-Sep-05 17:34 
QuestionHELP: expose windows Form from Windows Service Pin
SongDog8-Sep-05 3:51
SongDog8-Sep-05 3:51 
Questionsending parameter from Vs.Net to crystal Pin
kings_17-Sep-05 23:55
kings_17-Sep-05 23:55 
Questionw3wp.exe and high memory usage Pin
Pongsuriya7-Sep-05 19:52
Pongsuriya7-Sep-05 19:52 
AnswerRe: w3wp.exe and high memory usage Pin
Saksida Bojan7-Sep-05 22:32
Saksida Bojan7-Sep-05 22:32 
QuestionWriting obfuscator Pin
saitou7-Sep-05 13:00
saitou7-Sep-05 13:00 
QuestionCustom-shaped button: edges questions. Pin
subAdm6-Sep-05 21:30
subAdm6-Sep-05 21:30 
Here's how I draw it:

protected override void OnPaint(PaintEventArgs e)
{
	base.OnPaint (e);

	Graphics g=e.Graphics;
	g.SmoothingMode=SmoothingMode.AntiAlias;//<------------------ Cause no effect!

	GraphicsPath gp=new GraphicsPath();

	int border=5;

	int x=0;
	int y=0;
	int w=this.Width;
	int h=this.Height;
	int r=10;
	int d=r*2;

	Point lp1= new Point(x+r,y);
	Point lp2= new Point(x+w-r,y);
	Point lp3= new Point(x+w,y+r);
	Point lp4= new Point(x+w,y+h-r);
	Point lp5= new Point(x+w-r,y+h);
	Point lp6= new Point(x+r,y+h);
	Point lp7= new Point(x,y+h-r);
	Point lp8= new Point(x,y+r);

	Rectangle ar1= new Rectangle(x,y,d,d);
	Rectangle ar2= new Rectangle(x+w-d,y,d,d);
	Rectangle ar3= new Rectangle(x+w-d,y+h-d,d,d);
	Rectangle ar4= new Rectangle(x,y+h-d,d,d);

	Pen p=new Pen(Brushes.Black,border);
	//p.DashStyle=DashStyle.Solid; <----------------------------- Is it needed?
	SolidBrush b=new SolidBrush(System.Drawing.Color.Wheat);
	
	gp.AddArc(ar1,180,90);
	gp.AddLine(lp1,lp2);
	gp.AddArc(ar2,270,90);
	gp.AddLine(lp3,lp4);
	gp.AddArc(ar3,0,90);
	gp.AddLine(lp5,lp6);
	gp.AddArc(ar4,90,90);
	gp.AddLine(lp7,lp8);

	g.DrawPath(p,gp);
	//g.FillPath(b,gp);//<---------------------- Is it needed?
	this.Region=new Region(gp);

	x=0;
	y=0;
	w=this.Width;
	h=this.Height;

	lp1= new Point(x+r,y);
	lp2= new Point(x+w-r,y);
	lp3= new Point(x+w,y+r);
	lp4= new Point(x+w,y+h-r);
	lp5= new Point(x+w-r,y+h);
	lp6= new Point(x+r,y+h);
	lp7= new Point(x,y+h-r);
	lp8= new Point(x,y+r);

	ar1= new Rectangle(x,y,d,d);
	ar2= new Rectangle(x+w-d,y,d,d);
	ar3= new Rectangle(x+w-d,y+h-d,d,d);
	ar4= new Rectangle(x,y+h-d,d,d);

	g.DrawArc(p,ar1,180,90);
	g.DrawLine(p,lp1,lp2);
	g.DrawArc(p,ar2,270,90);
	g.DrawLine(p,lp3,lp4);
	g.DrawArc(p,ar3,0,90);
	g.DrawLine(p,lp5,lp6);
	g.DrawArc(p,ar4,90,90);
	g.DrawLine(p,lp7,lp8);

	this.BackColor=Color.Wheat;

	g.Dispose();
}


And here's what problems I stumbled upon:

1. can't antialias button edges
2. border contour is shifted in bottom-right direction... and looks like it not being fully displayed (most visible on thin borders (~1-2px)

well... that's it by now, I guess

Many thanks in advance for any help!
QuestionSpeech Application with .NET Framework and Speech SDK 5.1 Pin
codeparas6-Sep-05 17:33
codeparas6-Sep-05 17:33 
AnswerRe: Speech Application with .NET Framework and Speech SDK 5.1 Pin
marslab_258-Sep-05 0:56
marslab_258-Sep-05 0:56 
QuestionHow the framework identifies events Pin
C Flat6-Sep-05 12:10
C Flat6-Sep-05 12:10 
AnswerRe: How the framework identifies events Pin
Christian Graus6-Sep-05 12:40
protectorChristian Graus6-Sep-05 12:40 
Questionmschart ActiveX control crashes in C# .NET appication Pin
Khoi Nguyen6-Sep-05 8:56
Khoi Nguyen6-Sep-05 8:56 
AnswerRe: mschart ActiveX control crashes in C# .NET appication Pin
Ejrr108515-Sep-09 11:57
Ejrr108515-Sep-09 11:57 
QuestionNew transaction cannot enlist Pin
ProffK5-Sep-05 22:12
ProffK5-Sep-05 22:12 
Question.NET FX 2.0 compatible with older versions? Pin
Lord Kixdemp5-Sep-05 12:09
Lord Kixdemp5-Sep-05 12:09 
AnswerRe: .NET FX 2.0 compatible with older versions? Pin
Christian Graus5-Sep-05 12:18
protectorChristian Graus5-Sep-05 12:18 
GeneralRe: .NET FX 2.0 compatible with older versions? Pin
Lord Kixdemp6-Sep-05 10:05
Lord Kixdemp6-Sep-05 10:05 
Questionadd a column dynamically to a datagrid in Winforms Pin
Member 22510155-Sep-05 10:03
Member 22510155-Sep-05 10:03 
QuestionBooks about .NET with examples for learning Pin
hcmuns5-Sep-05 0:59
susshcmuns5-Sep-05 0:59 
AnswerRe: Books about .NET with examples for learning Pin
Christian Graus5-Sep-05 12:19
protectorChristian Graus5-Sep-05 12:19 
QuestionThread and resource handles leak in .NET 1.1 Pin
ischen_s14-Sep-05 6:21
ischen_s14-Sep-05 6:21 
AnswerRe: Thread and resource handles leak in .NET 1.1 Pin
Dave Kreskowiak4-Sep-05 6:42
mveDave Kreskowiak4-Sep-05 6:42 
AnswerRe: Thread and resource handles leak in .NET 1.1 Pin
Christian Graus4-Sep-05 16:05
protectorChristian Graus4-Sep-05 16:05 
AnswerRe: Thread and resource handles leak in .NET 1.1 Pin
ischen_s14-Sep-05 20:47
ischen_s14-Sep-05 20:47 

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.