[RESOLVED] Picture As Button or Other Button Style?
Hi. I've been doing Visual Basic for a bit now, and I've gotten along fine, but now I started to make a mobile calculator, and I want to make a bit more visually appealing, so i want to use a picture as a button, or some other type of way to make them look better, like applying a visual style. Does anyone have any idea how to do this? I've just searched for 45 minutes and can't seem to find any answer. Any help is appreciated. Thanks! :) (Oh, yeah, I'm using Windows Mobile 5, Net Framework 3.5, and Visual Studio 2008 with VB.)
Re: Picture As Button or Other Button Style?
Hey,
Welcome to the forums!!
There is nothing to stop you using a PictureBox as a button, and then using the Click Event of the PictureBox to carry out some action.
Having said that, since you are developing a UI for a Windows Mobile device you have to consider things like processing speed and limited screen resolution. You are going to have to be careful that your UI doesn't become too cluttered and busy to the point that it isn't usable.
Gary
Re: Picture As Button or Other Button Style?
Thanks for the help! :) I will definately take the device limitations into consideration as I start to use PictureBoxes for buttons and such. They're actually quite use as backgrounds for tabs, but hog a decent amount of memory, and can really slow down low RAM devices, like the older Treos with only 32 MB. Again, thanks! :D
Re: [RESOLVED] Picture As Button or Other Button Style?
Hey,
I just show this article on CodeProject:
http://www.codeproject.com/KB/mobile/CFIconMenu.aspx
And I thought that is might interest you.
Gary
Re: [RESOLVED] Picture As Button or Other Button Style?
Thanks again! That article is quite useful, and I might use it for a main launcher. :afrog: There is one thing though... using PictureBoxes, I am quite puzzled at how to change the box while it is being tapped. :ehh: Do you know how to do this? Thanks again for all your great help. :)
Re: [RESOLVED] Picture As Button or Other Button Style?
Hey,
You mean when you click it have the appearance of the button being pushed?
If so, then this is not something that you get for free using a PictureBox, only with a button control.
As an example, rather than using a PictureBox if that doesn't do everything that you want, how about using the following to create your own ImageButton Control:
http://msdn.microsoft.com/en-us/library/aa446518.aspx
Hope that helps!!
Gary
Re: [RESOLVED] Picture As Button or Other Button Style?
Thanks again! :D It's kind of consfusing (and in C#, nonetheless), but I should be able to apply the principles to Visual Basic. Thanks!
Re: [RESOLVED] Picture As Button or Other Button Style?
Ah, sorry about that, didn't realise that you were coding in C#.
If you are not familiar with it already, have a look at this website:
http://www.developerfusion.com/tools.../csharp-to-vb/
It will attempt to convert the C# code to VB.Net for you. It isn't always 100% correct, but it should get you the majority of the way.
Also, as you mentioned, it is the principles of the article that are important, not really the code.
Gary
Re: [RESOLVED] Picture As Button or Other Button Style?
Thanks! That tool is actually quite useful, as half the VS 2008 tutorials on graphics coding out there are in C#. One thing though -- you said:
Quote:
Originally Posted by
gep13
Ah, sorry about that, didn't realise that you were coding in C#.
but I'm coding in VB. Did you mistype? Thanks again. :)
Re: [RESOLVED] Picture As Button or Other Button Style?
Ooops, yeah that was my mistake, sorry for any confusion, i meant VB.
I must have had C# on the brain, that is the language that I use most :)
Gary