Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Picture show in image1

I wont to have view of picture in image1 when I add path of picture in
list1, but nothing is hapening.
Can I get some help please.
Regards
Lopar



Private Sub CommandButton1_Click()
Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim e As String
Dim ImgPath



a = TextBox3.Text
b = TextBox2.Text
c = TextBox4.Text
d = TextBox5.Text
e = TextBox6.Text
list1.AddItem a & c & d & b & e
List2.AddItem c & d & b & e

If list1.ListIndex = -1 Then Exit Sub
ImgPath = list1.List(list1.ListIndex)
Image1.Picture = StdFunctions.LoadPicture(ImgPath)




TextBox2.Text = ""

TextBox2.SetFocus




End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Picture show in image1


Hello Ivica Lopar,

Try this...


Code:
--------------------
Private Sub CommandButton1_Click()
Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim e As String
Dim ImgPath


a = TextBox3.Text
b = TextBox2.Text
c = TextBox4.Text
d = TextBox5.Text
e = TextBox6.Text
list1.AddItem a & c & d & b & e
List2.AddItem c & d & b & e

'Get the last Image Path added to List1
ImgPath = list1.List(list1.Count - 1)
Image1.Picture = StdFunctions.LoadPicture(ImgPath)


TextBox2.Text = ""

TextBox2.SetFocus


End Sub

--------------------

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=484703

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Picture show in image1



doesnt work
ImgPath = list1.List(list1.Count - 1)
**** doesnt recognize


*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Picture show in image1

It is working
Thank You so much
Where can I get good Book For Vb for excel
or where can I get few excamples

lop

*** Sent via Developersdex http://www.developersdex.com ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Picture show in image1


Hello Lopar,

If List1 is a ListBox control, the property .ListCount is valid. I
apologize for the typing error that Tom caught. Second, make sure the
ImagePath is fully qualified.

IMAGE PATH EXAMPLE:
imgPath = "C:\My Documents\Picture\img001.jpg"

If your image path is not like the example, it will not load the Image
control.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=484703



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Picture show in image1

Actually, your post wasn't visible when I posted. We just happen to
recommend the same solution.

--
Regards,
Tom Ogilvy

"Leith Ross" wrote
in message ...

Hello Lopar,

If List1 is a ListBox control, the property .ListCount is valid. I
apologize for the typing error that Tom caught. Second, make sure the
ImagePath is fully qualified.

IMAGE PATH EXAMPLE:
imgPath = "C:\My Documents\Picture\img001.jpg"

If your image path is not like the example, it will not load the Image
control.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:

http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=484703



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Picture show in image1

Private Sub CommandButton1_Click()
Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim e As String
Dim ImgPath



a = TextBox3.Text
b = TextBox2.Text
c = TextBox4.Text
d = TextBox5.Text
e = TextBox6.Text
list1.AddItem a & c & d & b & e
List2.AddItem c & d & b & e


ImgPath = list1.List(list1.ListCount - 1)
Image1.Picture = StdFunctions.LoadPicture(ImgPath)




TextBox2.Text = ""

TextBox2.SetFocus




End Sub

This assumes your path is properly created by concatenating textboxes.

--
Regards,
Tom Ogilvy


"Ivica Lopar" wrote in message
...
I wont to have view of picture in image1 when I add path of picture in
list1, but nothing is hapening.
Can I get some help please.
Regards
Lopar



Private Sub CommandButton1_Click()
Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim e As String
Dim ImgPath



a = TextBox3.Text
b = TextBox2.Text
c = TextBox4.Text
d = TextBox5.Text
e = TextBox6.Text
list1.AddItem a & c & d & b & e
List2.AddItem c & d & b & e

If list1.ListIndex = -1 Then Exit Sub
ImgPath = list1.List(list1.ListIndex)
Image1.Picture = StdFunctions.LoadPicture(ImgPath)




TextBox2.Text = ""

TextBox2.SetFocus




End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use an IF statement to show a picture? Mikey C Excel Discussion (Misc queries) 3 May 21st 07 06:21 PM
EXCEL won't show picture Doogie Excel Discussion (Misc queries) 0 April 6th 07 09:40 PM
Declear which picture I want to show and not?! petterss Excel Discussion (Misc queries) 0 August 11th 06 10:35 AM
Declear which picture I want to show and not?! petterss Excel Worksheet Functions 0 August 11th 06 10:31 AM
Show picture with transparencies in Image Jens Meier Excel Programming 5 August 9th 05 02:53 AM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"