473,811 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Non-Rectangular Form Question

Hi,

i have some questions about non-rectangular forms

1) i build a form as a non-rectangular by setting the form background to
some bmp file and the transparenceyKe y to the
color which i want to make transparent and every thing ok BUT when i m
replacing the bmp
file i can see the new one in the form designer but when i m running the
program i m getting the old bmp file.
i tried to remove the background but it didn't help.
what i m missing ?

2) how can i make a non-rectangular form for monitors which working with
more than 24 bit color depth ?

3) how can i make the non-rectangular form to be resizable ?

4) how can i prevent the duplicating of the background bmp file on the form
?

--
Best Regards ,

Tiraman :-)
Nov 20 '05 #1
5 1058
* "Tiraman" <ti*****@netvis ion.net.il> scripsit:
i have some questions about non-rectangular forms

1) i build a form as a non-rectangular by setting the form background to
some bmp file and the transparenceyKe y to the
color which i want to make transparent and every thing ok BUT when i m
replacing the bmp
file i can see the new one in the form designer but when i m running the
program i m getting the old bmp file.
i tried to remove the background but it didn't help.
what i m missing ?

2) how can i make a non-rectangular form for monitors which working with
more than 24 bit color depth ?


Instead of using 'TransparencyKe y' to archieve transparency, you can
create a 'System.Drawing .Drawing2D.Grpa hicsPath' or appropriate shape,
create a 'Region' object from it and assign it to the form's 'Region'
property at runtime.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi,

How to do it yourself.
http://msdn.microsoft.com/library/de...lStudioNET.asp

Region master controls
http://www.windowsforms.com/Samples/...179&tabindex=4

MSDN TV episode on Region master controls.
http://msdn.microsoft.com/msdntv/epi...H/manifest.xml

Ken
-----------------------
"Tiraman" <ti*****@netvis ion.net.il> wrote in message
news:Ot******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

i have some questions about non-rectangular forms

1) i build a form as a non-rectangular by setting the form background to
some bmp file and the transparenceyKe y to the
color which i want to make transparent and every thing ok BUT when i m
replacing the bmp
file i can see the new one in the form designer but when i m running
the
program i m getting the old bmp file.
i tried to remove the background but it didn't help.
what i m missing ?

2) how can i make a non-rectangular form for monitors which working with
more than 24 bit color depth ?

3) how can i make the non-rectangular form to be resizable ?

4) how can i prevent the duplicating of the background bmp file on the
form
?

--
Best Regards ,

Tiraman :-)

Nov 20 '05 #3
Hi Tiraman,

What I find one of the nicest samples I have made.

See beneath (You can open a project and just paste above the end class
line).

I hope this helps?

Cor

\\\made by Cor Ligthert from ideas I got from Herfried. K. Wagner and Fergus
Cooney
Private WithEvents button1 As New Button
Private mouseX, mouseY As Integer
Private myMouseDown As Boolean
Private Sub Form1_Load(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Dim g As New System.Drawing. Drawing2D.Graph icsPath
g.AddString("HT H" & vbCrLf & "Cor", _
System.Drawing. FontFamily.Gene ricSansSerif, _
System.Drawing. FontStyle.Bold, 200, _
New Point(0, 0), _
System.Drawing. StringFormat.Ge nericDefault)
Me.BackColor = Color.Red
Me.Region = New System.Drawing. Region(g)
g.Dispose()
Me.AutoScaleBas eSize = New System.Drawing. Size(0, 0)
Me.ClientSize = New System.Drawing. Size(500, 450)
button1.BackCol or = System.Drawing. SystemColors.Ac tiveCaptionText
button1.ForeCol or = System.Drawing. Color.Black
button1.Locatio n = New System.Drawing. Point(425, 18)
button1.Size = New System.Drawing. Size(20, 20)
Me.Controls.Add (button1)
button1.Text = "X"
Me.Location = New System.Drawing. Point(50, 50)
End Sub
Private Sub Button1_Click(B yVal sender As Object, _
ByVal e As System.EventArg s) Handles button1.Click
Me.Close()
End Sub
Private Sub Form1_MouseDown (ByVal sender As Object, ByVal _
e As System.Windows. Forms.MouseEven tArgs) Handles MyBase.MouseDow n
myMouseDown = True
mouseX = Cursor.Position .X - Me.Location.X
mouseY = Cursor.Position .Y - Me.Location.Y
End Sub
Private Sub Form1_MouseMove (ByVal sender As Object, ByVal e _
As System.Windows. Forms.MouseEven tArgs) Handles MyBase.MouseMov e
Static LastCursor As Point
Dim NowCursor As Point = New Point(Cursor.Po sition.X,
Cursor.Position .Y)
If Point.op_Inequa lity(NowCursor, LastCursor) Then
If myMouseDown Then
Me.Location = New System.Drawing. Point(Cursor.Po sition.X _
- mouseX, Cursor.Position .Y - mouseY)
End If
LastCursor = Cursor.Position
End If
End Sub
Private Sub Form1_MouseUp(B yVal sender As Object, ByVal e As _
System.Windows. Forms.MouseEven tArgs) Handles MyBase.MouseUp
myMouseDown = False
End Sub
///
Nov 20 '05 #4
Hi Cor,

it is a nice example :-)
so 10x and bye

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:u3******** ******@TK2MSFTN GP12.phx.gbl...
Hi Tiraman,

What I find one of the nicest samples I have made.

See beneath (You can open a project and just paste above the end class
line).

I hope this helps?

Cor

\\\made by Cor Ligthert from ideas I got from Herfried. K. Wagner and Fergus Cooney
Private WithEvents button1 As New Button
Private mouseX, mouseY As Integer
Private myMouseDown As Boolean
Private Sub Form1_Load(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Dim g As New System.Drawing. Drawing2D.Graph icsPath
g.AddString("HT H" & vbCrLf & "Cor", _
System.Drawing. FontFamily.Gene ricSansSerif, _
System.Drawing. FontStyle.Bold, 200, _
New Point(0, 0), _
System.Drawing. StringFormat.Ge nericDefault)
Me.BackColor = Color.Red
Me.Region = New System.Drawing. Region(g)
g.Dispose()
Me.AutoScaleBas eSize = New System.Drawing. Size(0, 0)
Me.ClientSize = New System.Drawing. Size(500, 450)
button1.BackCol or = System.Drawing. SystemColors.Ac tiveCaptionText
button1.ForeCol or = System.Drawing. Color.Black
button1.Locatio n = New System.Drawing. Point(425, 18)
button1.Size = New System.Drawing. Size(20, 20)
Me.Controls.Add (button1)
button1.Text = "X"
Me.Location = New System.Drawing. Point(50, 50)
End Sub
Private Sub Button1_Click(B yVal sender As Object, _
ByVal e As System.EventArg s) Handles button1.Click
Me.Close()
End Sub
Private Sub Form1_MouseDown (ByVal sender As Object, ByVal _
e As System.Windows. Forms.MouseEven tArgs) Handles MyBase.MouseDow n
myMouseDown = True
mouseX = Cursor.Position .X - Me.Location.X
mouseY = Cursor.Position .Y - Me.Location.Y
End Sub
Private Sub Form1_MouseMove (ByVal sender As Object, ByVal e _
As System.Windows. Forms.MouseEven tArgs) Handles MyBase.MouseMov e
Static LastCursor As Point
Dim NowCursor As Point = New Point(Cursor.Po sition.X,
Cursor.Position .Y)
If Point.op_Inequa lity(NowCursor, LastCursor) Then
If myMouseDown Then
Me.Location = New System.Drawing. Point(Cursor.Po sition.X _
- mouseX, Cursor.Position .Y - mouseY)
End If
LastCursor = Cursor.Position
End If
End Sub
Private Sub Form1_MouseUp(B yVal sender As Object, ByVal e As _
System.Windows. Forms.MouseEven tArgs) Handles MyBase.MouseUp
myMouseDown = False
End Sub
///

Nov 20 '05 #5
hello ken,

10x for the articles, they are good !

bye
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:eL******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

How to do it yourself.
http://msdn.microsoft.com/library/de...us/dv_vstechar
t/html/vbtchShapedWind owsFormsControl sInVisualStudio NET.asp
Region master controls
http://www.windowsforms.com/Samples/...mId=179&tabind
ex=4
MSDN TV episode on Region master controls.
http://msdn.microsoft.com/msdntv/epi...20040401WinFor
msMH/manifest.xml
Ken
-----------------------
"Tiraman" <ti*****@netvis ion.net.il> wrote in message
news:Ot******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

i have some questions about non-rectangular forms

1) i build a form as a non-rectangular by setting the form background to
some bmp file and the transparenceyKe y to the
color which i want to make transparent and every thing ok BUT when i m replacing the bmp
file i can see the new one in the form designer but when i m running
the
program i m getting the old bmp file.
i tried to remove the background but it didn't help.
what i m missing ?

2) how can i make a non-rectangular form for monitors which working with
more than 24 bit color depth ?

3) how can i make the non-rectangular form to be resizable ?

4) how can i prevent the duplicating of the background bmp file on the
form
?

--
Best Regards ,

Tiraman :-)


Nov 20 '05 #6

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

Similar topics

12
4439
by: lothar | last post by:
re: 4.2.1 Regular Expression Syntax http://docs.python.org/lib/re-syntax.html *?, +?, ?? Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few characters as possible will be matched. the regular expression module fails to perform non-greedy matches as described in the documentation: more than "as few characters as possible"
3
12275
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in nonblocking mode in c++? I did something ugly like --- c/c++ mixture --- mkfifo( "testpipe", 777);
32
4533
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
22
12067
by: Steve - DND | last post by:
We're currently doing some tests to determine the performance of static vs non-static functions, and we're coming up with some odd(in our opinion) results. We used a very simple setup. One class had a static function, and the one class had a non-static function. Both of these functions did the exact same thing. The test function: public void Test(){ decimal y = 2; decimal x = 3;
8
3522
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I cannot load/unload/reload extensions into my large and slow-to-load application during development without restarting the process then the disadvantages may outweigh the advantages. I've got a mixed-mode program in which I create a new AppDomain...
14
8485
by: Patrick Kowalzick | last post by:
Dear all, I have an existing piece of code with a struct with some PODs. struct A { int x; int y; };
11
3461
by: ypjofficial | last post by:
Hello All, So far I have been reading that in case of a polymorphic class ( having at least one virtual function in it), the virtual function call get resolved at run time and during that the vtable pointer is made use of.. eg. class one {
2
6127
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my pointers, but I'm not sure. Please help. The code: void equate(matrix *A, matrix *B) { int i, j; assert(A.row_dim == B.col_dim && A.col_dim == B.col_dim); for(i=0; i < A.row_dim; i++) for(j=0; j < A.col_dim; j++)
399
12981
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or to python-3000@python.org In summary, this PEP proposes to allow non-ASCII letters as identifiers in Python. If the PEP is accepted, the following identifiers would also become valid as class, function, or variable names: Löffelstiel,...
12
29931
by: puzzlecracker | last post by:
is it even possible or/and there is a better alternative to accept input in a nonblocking manner?
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10393
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.