PC Review


Reply
Thread Tools Rate Thread

Custom forms design ??

 
 
Poppy
Guest
Posts: n/a
 
      15th Dec 2003
A client of mine has asked if I could create customr forms for him. He does
not want them to be the typical rectangular shape.

Has anyone come across any tools or methods which can achieve this?

I have come across one control which claims to do this but at a hell of a
price !

TIA



 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      15th Dec 2003
"Poppy" <(E-Mail Removed)> schrieb
> A client of mine has asked if I could create customr forms for him.
> He does not want them to be the typical rectangular shape.


Have a look at the Scissors class.

;-)

No, not really - but what you can do is...

> Has anyone come across any tools or methods which can achieve
> this?


....assign a region to the Form's region property:

Dim gp As New System.Drawing.Drawing2D.GraphicsPath
gp.AddEllipse(Me.ClientRectangle)
Me.Region = New Region(gp)
gp.Dispose()


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
Jan Tielens
Guest
Posts: n/a
 
      15th Dec 2003
This is possible using default .NET, so no other components are needed.
Check out following code:

Private Sub GDIPlus_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim myGraphicsPath As New Drawing.Drawing2D.GraphicsPath()

myGraphicsPath.AddString("Hello!", New Drawing.FontFamily("Trebuchet
MS"), _
Drawing.FontStyle.Bold, 100, New Drawing.PointF(10, 50),
Drawing.StringFormat.GenericDefault)
myGraphicsPath.AddRectangle(New Drawing.Rectangle(0, 0, 1000, 30))

Me.Region = New Drawing.[Region](myGraphicsPath)

End Sub

Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
Dim myGraphicsPath As New Drawing.Drawing2D.GraphicsPath()

Dim rect As Rectangle = New Rectangle(10, 30, 600, 100)
Dim linGrBrush As System.Drawing.Drawing2D.LinearGradientBrush = New
System.Drawing.Drawing2D.LinearGradientBrush( _
rect, Color.Red, Color.Blue,
System.Drawing.Drawing2D.LinearGradientMode.Horizontal)

e.Graphics.FillRectangle(linGrBrush, rect)

End Sub

Source:
http://www.dotnet247.com/247referenc...22/113187.aspx



--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


"Poppy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> A client of mine has asked if I could create customr forms for him. He

does
> not want them to be the typical rectangular shape.
>
> Has anyone come across any tools or methods which can achieve this?
>
> I have come across one control which claims to do this but at a hell of a
> price !
>
> TIA
>
>
>



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      15th Dec 2003
Hi Poppy,

Worked at by Herfried, Fergus and Cor

\\\
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim g As New System.Drawing.Drawing2D.GraphicsPath
g.AddString( _
"Poppy", _
System.Drawing.FontFamily.GenericSansSerif, _
System.Drawing.FontStyle.Bold, _
200, _
New Point(0, 0), _
System.Drawing.StringFormat.GenericDefault _
)
Me.BackColor = Color.Red
Me.Region = New System.Drawing.Region(g)
g.Dispose()
Me.AutoScaleBaseSize = New System.Drawing.Size(0, 0)
Me.ClientSize = New System.Drawing.Size(800, 800)
Button1.BackColor = System.Drawing.SystemColors.ActiveCaptionText
Button1.ForeColor = System.Drawing.Color.Red
Button1.Location = New System.Drawing.Point(50, 40)
Button1.Size = New System.Drawing.Size(20, 20)
Button1.Text = "X"
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
///

I hope this helps a little bit?

Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Dec 2003
* "Poppy" <(E-Mail Removed)> scripsit:
> A client of mine has asked if I could create customr forms for him. He does
> not want them to be the typical rectangular shape.
>
> Has anyone come across any tools or methods which can achieve this?
>
> I have come across one control which claims to do this but at a hell of a
> price !


\\\
Me.FormBorderStyle = FormBorderStyle.None
Me.Height = 300
Me.Width = 400
Dim p As New Drawing2D.GraphicsPath()
p.StartFigure()
p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
p.AddLine(40, 0, Me.Width - 40, 0)
p.AddArc(New Rectangle(Me.Width - 40, 0, 40, 40), -90, 90)
p.AddLine(Me.Width, 40, Me.Width, Me.Height - 40)
p.AddArc(New Rectangle(Me.Width - 40, Me.Height - 40, 40, 40), 0, 90)
p.AddLine(Me.Width - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
p.Dispose()
Me.BackColor = Color.Red
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      15th Dec 2003
Hi Herfried,
You again did not look what I was sending
:-))
Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2003 Custom Forms Don't Open in Design View Captain Microsoft Outlook Form Programming 1 25th Feb 2008 11:52 PM
can't design some custom forms shown in Access 2003 database. =?Utf-8?B?Q2hhcmxpZSBT?= Microsoft Access Database Table Design 0 11th Oct 2006 03:20 AM
Custom Design Templates with custom guides =?Utf-8?B?Vzk1MUJZMw==?= Microsoft Powerpoint 3 26th Jun 2006 07:23 PM
details on how to design custom task forms =?Utf-8?B?YmVuZGVy?= Microsoft Outlook Form Programming 1 17th Jun 2005 12:32 AM
Custom Properties and Custom Controls - design time changes reflected visually. Wayne Microsoft VB .NET 0 31st Jul 2004 09:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 PM.