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

User Interface in VB 2005

Where can I find articles about UI?
Specially:
1) using actions like hover effects.
2) communications between a SWF file and a VB application.

I'm using this code to simulate an effect, but it is heavy:

Private Sub pb1_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles pb1.MouseEnter, pb2.MouseHover, pb3.MouseHover

Dim pb As PictureBox = sender
For Each c As Control In Me.Controls
If Not c Is pb Then pb1_MouseLeave(c, e)
Next
pb.BorderStyle = BorderStyle.Fixed3D
End Sub

Private Sub pb1_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles pb1.MouseLeave, pb2.MouseLeave, pb3.MouseLeave

Dim pb As PictureBox = sender
pb.BorderStyle = BorderStyle.None

End Sub

'NOTE: there are only picture boxes on the form.

Any idea to do it using it a better way?

Thanks

--
Saber S.
http://maghalat.com
Dec 17 '05 #1
11 1724
No idea?
How can I make image switching faster and reduce the delay?

"Saber" <saber[.AT.]oxin.ir> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Where can I find articles about UI?
Specially:
1) using actions like hover effects.
2) communications between a SWF file and a VB application.

I'm using this code to simulate an effect, but it is heavy:

Private Sub pb1_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles pb1.MouseEnter, pb2.MouseHover, pb3.MouseHover

Dim pb As PictureBox = sender
For Each c As Control In Me.Controls
If Not c Is pb Then pb1_MouseLeave(c, e)
Next
pb.BorderStyle = BorderStyle.Fixed3D
End Sub

Private Sub pb1_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles pb1.MouseLeave, pb2.MouseLeave, pb3.MouseLeave

Dim pb As PictureBox = sender
pb.BorderStyle = BorderStyle.None

End Sub

'NOTE: there are only picture boxes on the form.

Any idea to do it using it a better way?

Thanks

--
Saber S.
http://maghalat.com

Dec 20 '05 #2
"Saber" <saber[.AT.]oxin.ir> schrieb>
No idea?

You didn't write what the problem was, only that it is "heavy". I didn't
know what it meant.
How can I make image switching faster and reduce the delay?


Which images do you want to switch? Which delay is there?

Private Sub pb1_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles pb1.MouseEnter, pb2.MouseHover, pb3.MouseHover


Shouldn't this be

Handles pb1.MouseEnter, pb2.MouseEnter, pb3.MouseEnter
Armin

Dec 20 '05 #3
Thank for your response Armin,
I've three picture box, when user hovers on a picture box,
I want the picture changes and when the mouse leaves picture box,
the old picture load in picture box again.
It is easy in HTML:
http://www.howtocreate.co.uk/tutoria...stingRoll.html
but it causes a delay to change the pictures in VB when a mouse event
occurs. (at least by my method!)
I want a good way to simulate HTML mouseover/hover/rolling effect in VB.
Handles pb1.MouseEnter, pb2.MouseHover, pb3.MouseHover
Shouldn't this be

Handles pb1.MouseEnter, pb2.MouseEnter, pb3.MouseEnter
That was a cut/paste error, it is:
Handles pb1.MouseHover, pb2.MouseHover, pb3.MouseHover

--
Saber S.
http://maghalat.com

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uK**************@TK2MSFTNGP12.phx.gbl... "Saber" <saber[.AT.]oxin.ir> schrieb>
No idea?

You didn't write what the problem was, only that it is "heavy". I didn't
know what it meant.
How can I make image switching faster and reduce the delay?


Which images do you want to switch? Which delay is there?

Private Sub pb1_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles pb1.MouseEnter, pb2.MouseHover, pb3.MouseHover


Shouldn't this be

Handles pb1.MouseEnter, pb2.MouseEnter, pb3.MouseEnter
Armin

Dec 20 '05 #4
"Saber" <saber[.AT.]oxin.ir> schrieb
Thank for your response Armin,
I've three picture box, when user hovers on a picture box,
I want the picture changes and when the mouse leaves picture box,
the old picture load in picture box again.
It is easy in HTML:
http://www.howtocreate.co.uk/tutoria...stingRoll.html
but it causes a delay to change the pictures in VB when a mouse
event occurs. (at least by my method!)
I want a good way to simulate HTML mouseover/hover/rolling effect in
VB.


How much delay is it (approximate)? 200 ms, 500 ms, 1000 ms, 5000 ms - just
to get an imagination of it.

How do you set the picture? It was not shown in your code.

I tried it and can't see any noticable delay. Not even with 1280x1024
bitmaps with picbox.sizemode = strechimage. This is the code:

Private Sub PictureBox_MouseEnter( _
ByVal sender As Object, ByVal e As System.EventArgs) _
Handles PictureBox1.MouseEnter, PictureBox2.MouseEnter, _
PictureBox3.MouseEnter

DirectCast(sender, PictureBox).Image = Me.PictureBox4.Image

End Sub

Private Sub PictureBox_MouseLeave( _
ByVal sender As Object, ByVal e As System.EventArgs) _
Handles PictureBox1.MouseLeave, PictureBox2.MouseLeave, _
PictureBox3.MouseLeave

DirectCast(sender, PictureBox).Image = Me.PictureBox5.Image
End Sub
PictureBox1, PictureBox2 and PictureBox3 are also 3 Pictureboxes.
PictureBox4 and PictureBox5 are only there to contain the picture (was the
simplest way to create a sample using the designer).

Armin

Dec 20 '05 #5
Approximately delay is 500 ms, I use small transparent gif images (2 KB)
added to resource.
I'll send the source code and images to your email address.

Thanks

"Armin Zingler" <az*******@freenet.de> wrote in message
news:OT**************@TK2MSFTNGP09.phx.gbl...
"Saber" <saber[.AT.]oxin.ir> schrieb
Thank for your response Armin,
I've three picture box, when user hovers on a picture box,
I want the picture changes and when the mouse leaves picture box,
the old picture load in picture box again.
It is easy in HTML:
http://www.howtocreate.co.uk/tutoria...stingRoll.html
but it causes a delay to change the pictures in VB when a mouse
event occurs. (at least by my method!)
I want a good way to simulate HTML mouseover/hover/rolling effect in
VB.


How much delay is it (approximate)? 200 ms, 500 ms, 1000 ms, 5000 ms -
just
to get an imagination of it.

How do you set the picture? It was not shown in your code.

I tried it and can't see any noticable delay. Not even with 1280x1024
bitmaps with picbox.sizemode = strechimage. This is the code:

Private Sub PictureBox_MouseEnter( _
ByVal sender As Object, ByVal e As System.EventArgs) _
Handles PictureBox1.MouseEnter, PictureBox2.MouseEnter, _
PictureBox3.MouseEnter

DirectCast(sender, PictureBox).Image = Me.PictureBox4.Image

End Sub

Private Sub PictureBox_MouseLeave( _
ByVal sender As Object, ByVal e As System.EventArgs) _
Handles PictureBox1.MouseLeave, PictureBox2.MouseLeave, _
PictureBox3.MouseLeave

DirectCast(sender, PictureBox).Image = Me.PictureBox5.Image
End Sub
PictureBox1, PictureBox2 and PictureBox3 are also 3 Pictureboxes.
PictureBox4 and PictureBox5 are only there to contain the picture (was the
simplest way to create a sample using the designer).

Armin

Dec 21 '05 #6
"Saber" <saber[.AT.]oxin.ir> schrieb
Approximately delay is 500 ms, I use small transparent gif images (2
KB) added to resource.
I'll send the source code and images to your email address.


Insert an underscore: az.no_spam@....
Armin
Dec 21 '05 #7
"Saber" <saber[.AT.]oxin.ir> schrieb
Approximately delay is 500 ms, I use small transparent gif images (2
KB) added to resource.
I'll send the source code and images to your email address.

Took some time to get a compilable project from the files you sent. I can't
see any delay when hovering over the picboxes (Athlon 64 3000+, GF 6800).
What you can try is to load the resources only once, not each time you
change the image.
Armin

Dec 21 '05 #8
Sorry for inconvenience!
I'm using Athlon 1800+, GF MX 440.
What you can try is to load the resources only once, not each time you
change the image. Would you please explain more about it?
"Armin Zingler" <az*******@freenet.de> wrote in message
news:eQ**************@TK2MSFTNGP15.phx.gbl... "Saber" <saber[.AT.]oxin.ir> schrieb
Approximately delay is 500 ms, I use small transparent gif images (2
KB) added to resource.
I'll send the source code and images to your email address.

Took some time to get a compilable project from the files you sent. I
can't
see any delay when hovering over the picboxes (Athlon 64 3000+, GF 6800).
What you can try is to load the resources only once, not each time you
change the image.
Armin

Dec 22 '05 #9
"Saber" <saber[.AT.]oxin.ir> schrieb
Sorry for inconvenience!
No problem. Did it voluntarily. :)
I'm using Athlon 1800+, GF MX 440.
What you can try is to load the resources only once, not each time
you change the image.

Would you please explain more about it?

Each time you assign the image to the picturebox, you are referring to
"my.resources.*". This means that each time the image resource must be
loaded. On very slow PCs this might cause a delay. Your PC is not too slow
for this job, thus this is not the cause. To optimize the code, you could
load all images into an array or hashtable or other variables only at
startup, e.g. in form_load. When hovering over the pictureboxes, you will
already have the images in the variables. You don't have to load them each
time from the resource. But as I said, I don't think this will matter with
your machine; only if it was much slower (IMO, "old" machines are 500 MHz or
less; that's my personal limit). Therefore, I currently don't know what is
causing the delay. Anybody else can help?
Armin

Dec 22 '05 #10
Armin,

I did your tip and now using an array to keep images when form loads,
as you mentioned, it is not the reason of the delay problem, but logical!

still waiting for ideas..

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
"Saber" <saber[.AT.]oxin.ir> schrieb
Sorry for inconvenience!


No problem. Did it voluntarily. :)
I'm using Athlon 1800+, GF MX 440.
> What you can try is to load the resources only once, not each time
> you change the image.

Would you please explain more about it?

Each time you assign the image to the picturebox, you are referring to
"my.resources.*". This means that each time the image resource must be
loaded. On very slow PCs this might cause a delay. Your PC is not too slow
for this job, thus this is not the cause. To optimize the code, you could
load all images into an array or hashtable or other variables only at
startup, e.g. in form_load. When hovering over the pictureboxes, you will
already have the images in the variables. You don't have to load them each
time from the resource. But as I said, I don't think this will matter with
your machine; only if it was much slower (IMO, "old" machines are 500 MHz
or less; that's my personal limit). Therefore, I currently don't know what
is causing the delay. Anybody else can help?
Armin


Dec 22 '05 #11
I Finaly found the reason of problem:
Me.BackgroundImage = Global.pezeshki.My.Resources.Resources.bgmain1

after removing the background, there is no delay in hover effect.

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
"Saber" <saber[.AT.]oxin.ir> schrieb
Sorry for inconvenience!


No problem. Did it voluntarily. :)
I'm using Athlon 1800+, GF MX 440.
> What you can try is to load the resources only once, not each time
> you change the image.

Would you please explain more about it?

Each time you assign the image to the picturebox, you are referring to
"my.resources.*". This means that each time the image resource must be
loaded. On very slow PCs this might cause a delay. Your PC is not too slow
for this job, thus this is not the cause. To optimize the code, you could
load all images into an array or hashtable or other variables only at
startup, e.g. in form_load. When hovering over the pictureboxes, you will
already have the images in the variables. You don't have to load them each
time from the resource. But as I said, I don't think this will matter with
your machine; only if it was much slower (IMO, "old" machines are 500 MHz
or less; that's my personal limit). Therefore, I currently don't know what
is causing the delay. Anybody else can help?
Armin


Jan 3 '06 #12

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

Similar topics

3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
24
by: Rob R. Ainscough | last post by:
VS 2005 I have: ClickOnce deployment User's that hate and or don't want to use an IE Client (don't blame them) I don't see how ASPX web pages are going to survive? With .NET 2.0 and clickonce...
2
by: OSI Mik | last post by:
Hello, I try to make a user interface for a DB in VB.DOT 2005 with SQL server. I use auto generate Textbox and datagridview (with BindingSource, TableAdapter...) with manual add of ComboBox and I...
0
by: =?Utf-8?B?V2ViemVzdA==?= | last post by:
Greetings: I am attempting to generate a Microsoft Office Communicator 2005 client installer that needs to interface with a Web service that resides on the LCS Server. Specifically, the Web...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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
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,...
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...
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
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...

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.