473,387 Members | 1,678 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,387 software developers and data experts.

Skinning

I am interested in learning a bit about skinning.
I found an article:
http://www.developerfusion.com/show/3899/
However, it says the method shown is "not very practical."

Is there a good tutorial you can recommend? Or, is it something hard enough
that I should purchase a solution from somebody?

Thanks in advance,

Matthew
Nov 21 '05 #1
7 1814
Matthew,

Did you tried this for fun made sample of me?

\\\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(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim g As New System.Drawing.Drawing2D.GraphicsPath
g.AddString("HTH" & vbCrLf & "Cor", _
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(500, 450)
button1.BackColor = System.Drawing.SystemColors.ActiveCaptionText
button1.ForeColor = System.Drawing.Color.Black
button1.Location = 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(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles button1.Click
Me.Close()
End Sub
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal _
e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
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.MouseEventArgs) Handles MyBase.MouseMove
Static LastCursor As Point
Dim NowCursor As Point = New Point(Cursor.Position.X,
Cursor.Position.Y)
If Point.op_Inequality(NowCursor, LastCursor) Then
If myMouseDown Then
Me.Location = New System.Drawing.Point(Cursor.Position.X _
- mouseX, Cursor.Position.Y - mouseY)
End If
LastCursor = Cursor.Position
End If
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
myMouseDown = False
End Sub
///
I hope this helps?

Cor
Nov 21 '05 #2
Nak
Hi Matthew,

Ever messed around with XML? If not it would be a good idea that you
did, because it is perfect for what you are after. You could make your own
skinning engine and mark-up language, and I doubt it would be that hard. I
have often wanted to do this myself by have never got around to it, it would
be great for multi-lingual solutions!

Anyway, I have a couple of XML links for you,

http://www.planet-source-code.com/vb...00416265792200

http://www.members.lycos.co.uk/nickpatemanpwp/
My own software > Flying Frank Circus, quite a large project but shows
how to deal with loading XML (one of my first examples so it's not amazing,
but fun ;-) )

XML is excellent once you get the hang of it, I make quite allot of my
objects XML persistable, it's much easier to do it this way than via comma
delimited text documents that will have you searching for errors for hours!

Anyway, if your stuck on the concept of how to implement this, I suggest
you make a borderless form that loads its elements via XML and a shared
method. i.e. mySkinnedForm.fromFile("c:\pop.xml"). The XML file should
state positions and relevant graphics of controls, as well as their anchor
points. You will obviously have to a pool of objects for the form to load
from as it would be mighty tricky to get it to make controls that you
weren't expecting. A tiny example would be,

<?xml version="1.0"?>
<skinfile>
<objects>
<object>
<name>closebutton</name>
<location>10,10</location>
<size>50,15</size>
<normalbitmap>\normal.png</normalbitmap>
<overbitmap>\over.png</overbitmap>
<downbitmap>\down.png</downbitmap>
</object>
</objects>
</skinfile>

You could even add "scripts" to object events and do "on-the-fly"
compilation of .NET code. I done this for a project recently and found it
really fun, I hope this helps!

Nick.

"Matthew" <tu*************@alltel.net> wrote in message
news:O3**************@TK2MSFTNGP14.phx.gbl...
I am interested in learning a bit about skinning.
I found an article:
http://www.developerfusion.com/show/3899/
However, it says the method shown is "not very practical."

Is there a good tutorial you can recommend? Or, is it something hard
enough that I should purchase a solution from somebody?

Thanks in advance,

Matthew

Nov 21 '05 #3
> Ever messed around with XML? If not it would be a good idea that you
did, because it is perfect for what you are after.
Yes, I have done some work with XML. However, I didn't consider it for this
aplication. I love the idea!
I have a couple of XML links for you
I will check them out.
You could even add "scripts" to object events and do "on-the-fly"
compilation of .NET code.


That's an interesting concept. Do you have an example handy?

By the way, Nick, I hear that you are quite the expert on Shareware. I have
written a small program that I am considering distributing using this
method. Do you have any tips? Is there anything I should watch out for?

Matthew
Nov 21 '05 #4
> Did you tried this for fun made sample of me?

Thanks for the example, Cor. I will check it out.

Matthew
Nov 21 '05 #5
Nak
Hi Matthew,
By the way, Nick, I hear that you are quite the expert on Shareware. I
have written a small program that I am considering distributing using this
method. Do you have any tips? Is there anything I should watch out for?


I wouldn't exactly call myself an expert, far from it, but I have just
started selling my own software/ Yeah, I would love to give some advice,

-----------

* Don't try and make time limited demos of your software, they can be
easily cracked and people will end up turning the demo into a full version

* When making a demo, make it completely impossible to turn it into
the full version by using pre-compile constants evalution, for example,

# if (Not DEMOVERSION)
'do full version stuff
# else
'display message saying "you can't do that in the demo!"
# endif

* I would personally recommend a license file based system, this way
noone is going to be making key-generators for your application. I've used
signed XML files for my application, so if people "share" their license
file, they have been caught red-handed and I can brand their license as
invalid, no support for them! (Not that you can do much else about it).

* Get it onto a web site in demo and version as quick as you can,
you'll soon start refining it and getting bug reports in that you hadn't
even noticed.

-----------

I took ages getting mine online, but now it's on it's taking a whole new
lease of life, I'm looking forward to getting it onto Tucows (I hope I can),
because then I'll be able to see my monthly bandwith ebbing away from me!
Anyway, I recommend control licensing also if you are distributing a class
library with your project, so look at this article,

http://windowsforms.net/articles/Licensing.aspx

I will be selling my solution sooner or later, but that's a while off,
and it's going to be allot cheaper than anyone elses, but this isn't an
advert anyway (bla bla bla). But basically it was created by referring to
the above article and working out how the license provers work in the .NET
Framework (And most parts seem to still be undocumented).

Anyway, good luck none the less! I hope you get things done quicker
than myself! (1.5 years roughly!) :-)

Nick.
Nov 21 '05 #6
> You could even add "scripts" to object events and do "on-the-fly"
compilation of .NET code.
That's an interesting concept. Do you have an example handy? I'm afraid I
don't have any idea where to start with this.
* Don't try and make time limited demos of your software, they can
be easily cracked and people will end up turning the demo into a full
version
Nice thought. My software is designed for presentation; I will put a
watermark on the "display" part. That oughta be enough ;-)
* When making a demo, make it completely impossible to turn it into
the full version by using pre-compile constants evalution, for example,

# if (Not DEMOVERSION)
'do full version stuff
# else
'display message saying "you can't do that in the demo!"
# endif
I am not sure what you mean by pre-compile constants.

What I am doing now looks like this:
Private Sub Form1_Load( 'etc
If isRegistered() = True Then
'full version stuff
end if
End Sub

'in a module:
Function isRegistered()
if [regestration key exists in external text file and validates correctly]
then
return True
else
return false
end if
end function

Does this sound OK?
* I would personally recommend a license file based system, this way
noone is going to be making key-generators for your application. I've
used signed XML files for my application, so if people "share" their
license file, they have been caught red-handed and I can brand their
license as invalid, no support for them! (Not that you can do much else
about it).
I agree, licensing is the way to go. The concept of signed XML files sounds
very interisting. Can you point me in the right direction for some
information?
* Get it onto a web site in demo and version as quick as you can,
you'll soon start refining it and getting bug reports in that you hadn't
even noticed.
Sounds good to me. My app is not really complex. I am shooting for a
release in the next couple of weeks.
I took ages getting mine online, but now it's on it's taking a whole
new lease of life, I'm looking forward to getting it onto Tucows (I hope I
can), because then I'll be able to see my monthly bandwith ebbing away
from me! Anyway, I recommend control licensing also if you are
distributing a class library with your project, so look at this article,

http://windowsforms.net/articles/Licensing.aspx
I wish I saw that before I created my own liscensing scheme. I'm going on
vacation for a week, but I'll look at that closely when I get back.
Anyway, good luck none the less! I hope you get things done quicker
than myself! (1.5 years roughly!) :-)


As I said above, my app is very simple. My guess is it can't really compare
to your 1.5 year project ;-)
Thanks for your help.

Matthew
Nov 21 '05 #7
Matthew,

Almost a year ago Nick wrote "My programs need no obfuscator, I do not
understand them myself"

I found that then one of the best oneliners I saw about programming I will
remember it me forever including who wrote it.

It must have changed, as you see how much time he took to get this right the
last months.

:-)

Cor

"Matthew" <tu*************@alltel.net> schreef in bericht
news:eD****************@TK2MSFTNGP12.phx.gbl...
You could even add "scripts" to object events and do "on-the-fly"
compilation of .NET code.


That's an interesting concept. Do you have an example handy? I'm afraid
I don't have any idea where to start with this.
* Don't try and make time limited demos of your software, they can
be easily cracked and people will end up turning the demo into a full
version


Nice thought. My software is designed for presentation; I will put a
watermark on the "display" part. That oughta be enough ;-)
* When making a demo, make it completely impossible to turn it into
the full version by using pre-compile constants evalution, for example,

# if (Not DEMOVERSION)
'do full version stuff
# else
'display message saying "you can't do that in the demo!"
# endif


I am not sure what you mean by pre-compile constants.

What I am doing now looks like this:
Private Sub Form1_Load( 'etc
If isRegistered() = True Then
'full version stuff
end if
End Sub

'in a module:
Function isRegistered()
if [regestration key exists in external text file and validates correctly]
then
return True
else
return false
end if
end function

Does this sound OK?
* I would personally recommend a license file based system, this
way noone is going to be making key-generators for your application.
I've used signed XML files for my application, so if people "share" their
license file, they have been caught red-handed and I can brand their
license as invalid, no support for them! (Not that you can do much else
about it).


I agree, licensing is the way to go. The concept of signed XML files
sounds very interisting. Can you point me in the right direction for some
information?
* Get it onto a web site in demo and version as quick as you can,
you'll soon start refining it and getting bug reports in that you hadn't
even noticed.


Sounds good to me. My app is not really complex. I am shooting for a
release in the next couple of weeks.
I took ages getting mine online, but now it's on it's taking a whole
new lease of life, I'm looking forward to getting it onto Tucows (I hope
I can), because then I'll be able to see my monthly bandwith ebbing away
from me! Anyway, I recommend control licensing also if you are
distributing a class library with your project, so look at this article,

http://windowsforms.net/articles/Licensing.aspx


I wish I saw that before I created my own liscensing scheme. I'm going on
vacation for a week, but I'll look at that closely when I get back.
Anyway, good luck none the less! I hope you get things done quicker
than myself! (1.5 years roughly!) :-)


As I said above, my app is very simple. My guess is it can't really
compare to your 1.5 year project ;-)
Thanks for your help.

Matthew

Nov 21 '05 #8

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

Similar topics

3
by: Martín Heras | last post by:
Hello everybody... I am trying to apply some parts of the WinXP skins in panel controls. I am using the Uxtheme wrapper which you can download from www.codeproject.com and it is good. If I want...
2
by: Kim Skytte | last post by:
HI! I have a few questions about access . 1) Does anyone know if it is possible to apply skins to Access forms ?? 2) Is is possible to hide the main access windows, and just show the forms.
1
by: Paul Hartness | last post by:
I want to be able to skin my application producing non-standard form shapes such as WinAmp & Windows Media Player. I have reviewed toolkits such as DirectSkin, SkinCrafter, SkinBoxer, SkinMagic...
3
by: AtlasApollo | last post by:
Greetings! We are working on a project that has a bunch of TrackBars spec'ed as graphic controls. In other words, they are slick looking and green. In the design phase, these controls look...
2
by: meyer_phillip | last post by:
I am looking for an application skinning engine that supports colour themes. Winamp is an example of an app supporting colour themes. For example in Winamp I can pick the "Winamp Modern" skin and...
2
by: CJ Taylor | last post by:
I've been googling this for awhile, but can't seem to find anything really solid on skinning a windows forms app. I know how to skin the internal stuff but would like to see an example of stuff...
2
by: JJ | last post by:
I'm using Themes with asp.net 2.0 and i have a command field(in a gridview) like this: <asp:CommandField ButtonType=Image ShowDeleteButton= true...
1
by: anirban123 | last post by:
I have an existing forms application developed in C# .NET 2.0. I would like to know the easiest way of enhancing its look and feel/apply skinning. Please help ASAP.
7
by: Nik Coughlin | last post by:
Further to my earlier post in alt.html, I ended up preparing these pages: http://nrkn.com/skinning/ They list different ways to "skin" an HTML element (ie add rounded corners, drop shadows,...
1
by: samvb | last post by:
Hi, do u guys knw a good tutorial on skinning a website? I have a website which takes me days to update its look n i now, i wanna do some basic skinns for it. easily changeable. u kno any good...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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:
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
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...

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.