sir i have made a picture viewer application and i have a dirlistbox ,filelistbox ,drivelistbox and image list control on it .now when i select the drive where i have pictures and select the folder from the dirlist box and click on name of the picture in the file list box then the picture is displayed in the image list control.and when i press the right arrow key the next picture is displayed .now the problem is that how can i move from the last picture to the first picture by pressing the right arrow key.please help
9 2052
Can you provide details on exactly how you move to the next picture when the arrow key is pressed? (Is this simply due to the built-in keyboard navigation in the file list?)
Also, what version of VB is this?
sir the version of vb that i am using is Visual basic 6.0.
sir now i am submitting the details.i have made a picture viewer application .on which i have placed a image control and dirlistbox ,drivelistbox,and the filelistbox. in the coding of the file listbox i have entered - Private Sub file1_click()
-
Dim hello As String
-
hello = file1.Path & "\" & file1.FileName
-
If Right$(hello, 3) = "jpg" Then
-
image1.Picture = LoadPicture(hello)
-
Else
-
image1.Picture = LoadPicture(hello)
-
End If
-
If file1.ListIndex = file1.ListCount - 1 Then
-
file1.ListIndex = 0
-
End If
-
End Sub
according to this coding when i press the right arrow key then the next image is displayed in the image control.but when i reach on the end or at the last picture then the last picture is not displayed .now i want that when i reach on the last picture then the last picture should be displayed and when i again press the right arrow key then the first image should be displayed(as in the window picture and fax viewer).
u are moving to the next picture not because of your code ,but because of windows as th efocus is moving to the next item in the list.
try handling the keystroke and then try to change the index of the selected item in the list accordingly.
Hi,
I'd say that it's because sometimes the indexes of the file pickers start at 1.
Then just change the code to:
if file1.listindex=file1.listcount then
file1.listindex=1
end if
end sub
Good Luck
dear sir
the listindex of the file list box starts from 0 and the listcount is 1 greater than the last index of the filelilstbox.the coding that you send me is
if file1.listindex=file1.listcount then
file1.listindex=1
end if
according to this coding the listindex can not becomes equal to the listcount .therefore the after the last picture the first picture is not displayed when i press the right arrow key.
please help
dear sir
i know that i am not moving on the next picture through my code but i want that when i reach on the last picture and again i press the right arrow key then the first picture should be displayed.please send me the code so that i can understand the code and utilize it.
dear sir
i know that i am not moving on the next picture through my code but i want that when i reach on the last picture and again i press the right arrow key then the first picture should be displayed.please send me the code so that i can understand the code and utilize it.
once list index is equal to listcount-1, rest it to 0
Now lets see how u apply the logic.
next time post with your code ,what u have tried
Hi,
Sorry that didnt work (sometimes does)
May be it's a problem when you change the list index, and you can use a line like this: - file1.ListIndex = file1.ListIndex + 1
What have you already tried?
sir i have tried this logic like
if file1.listindex=file1.listcount-1 then
file1.listindex=0
end if
but according to this code the last picture is missed(not displayed) when the listindex become equal to the listcount-1 then focus jumps on the first picture.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bob |
last post by:
well i pretty much said it in the title.
i was wondering how would you make a picture box or an object repond
to the arrow keys.
for example i have a picture and i want to move right when i...
|
by: Svelte Poshy |
last post by:
I want to put a code in the control box with a picture of an arrow,
imitating the right arrow in the foot of the form with which the user
views the customers
one after another. My form is a...
|
by: Prakash |
last post by:
Hi !!
In a Continuous Form with say 10 records, I'd like to have 1 button
with an "UP" Arrow & another button with a "DOWN" arrow. By pressing
either the Up or the Down Arrow, I'd like the user...
|
by: Seash |
last post by:
Hi friends ,
here is the sample code
private void txtbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar == 13) //enter
{
txtbox2.Focus();
}
|
by: AndyG |
last post by:
Hey everyone. I just reinstalled my VS.Net and now for some reason, when i am in design mode and i try to move a control, it does not move the control. It ends up moving the scrollbar up or down as...
|
by: Doron Farber |
last post by:
Hi All,
How can I Move the Server explorer window to the left. When ever I double click on the Server explorer top window it goes to the bottom of the IDE.
Thanks,
Doron
|
by: VanKha |
last post by:
How to move the cursor( I'm programming with Win32 console applications in visual c++ 6.0) by letting the user type in arrow keys(and obviously, I will then have some variable column and row and use...
|
by: sandromani |
last post by:
Hello,
I was wondering if there was a way (in c++) to move the cursor when pressing the arrow keys instead of getting ^[[C resp. ^[[D (left resp. right arrow) in the cin input - I am using linux. I...
|
by: ivan |
last post by:
Hello,
How do I move the keyboard cursor position in a Tix.HList?
I am using an HList with the right mouse button bound to pop up a
menu. If the right click is done on an unselected item, I...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
| |