473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Custom forms design ??

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

Nov 20 '05 #1
5 1163
"Poppy" <pa**********@NOSPAMthemedialounge.com> 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

Nov 20 '05 #2
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.Horizo ntal)

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" <pa**********@NOSPAMthemedialounge.com> wrote in message
news:uT**************@TK2MSFTNGP10.phx.gbl...
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

Nov 20 '05 #3
Cor
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
Nov 20 '05 #4
* "Poppy" <pa**********@NOSPAMthemedialounge.com> 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>
Nov 20 '05 #5
Cor
Hi Herfried,
You again did not look what I was sending
:-))
Cor
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
3
by: Alvaro E. Gonzalez V. | last post by:
Hello!!! I'm building a control that in a property assign a Dataset which they are initialized and another property Like DataMember. Similar as it happens to the DataSource property of a...
0
by: Sanjay Pais | last post by:
This is an extension of an earlier post I have created a custom text box and compiled it and dropped it into my toolbox. However when I change the value of my custom property in design mode and...
5
by: ToddH | last post by:
I know the following code is C#. I'm a vb programmer trying to learn a new language. I posted this in the c# group but never got a response. You guys seem to know alot about all languages and have...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
4
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.