Results 1 to 14 of 14

Thread: Windows media

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    6

    Question Windows media

    i makeing a media player in visual basic

    but i have one problem with my code

    i have a code like this: "ProgressBarX1.Text = AxWindowsMediaPlayer1.Ctlcontrols.currentPosition" and the text on the progressbar is changing but it take 00:00:00:00

    i just want it to show just hours, minutes, seconds not mili seconds

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Windows media

    What is the type of that 'currentPosition' property? If it's TimeSpan, call ToString on it and pass the appropriate specifier for the format you want.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    6

    Re: Windows media

    Quote Originally Posted by jmcilhinney View Post
    What is the type of that 'currentPosition' property? If it's TimeSpan, call ToString on it and pass the appropriate specifier for the format you want.
    where can i se currentPosition' property?

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    6

    Re: Windows media

    in Windows media player Properties the Current position say it is 1.000

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Windows media

    Quote Originally Posted by themarwik View Post
    where can i se currentPosition' property?
    Um, in your code.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Windows media

    Quote Originally Posted by themarwik View Post
    in Windows media player Properties the Current position say it is 1.000
    I asked what the type is, not the value. Is it String? Double? TimeSpan? Something else?

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    6

    Re: Windows media

    it working now. i set it to ProgressBarX1.Text = AxWindowsMediaPlayer1.Ctlcontrols.currentPositionString
    Last edited by themarwik; Oct 18th, 2017 at 07:09 AM.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Windows media

    That is exactly what you should expect from that code. Now, are you going to answer my question or not? If not then please say so because I'd rather not keep asking the same question over and over.

  9. #9

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    6

    Re: Windows media

    its a string

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Windows media

    What you have said so far doesn't really add up. You said in post #1 that you get something in 00:00:00:00 format and in post #4 you said that it has the value 1.000. If you get a String that contains "1.000" and you display it in a TextBox then you won't magically get something in the format you originally stated. If it is a String then you need to parse it to a number or the like and then format it as required but we can't tell you how to parse it if you can't actually describe clearly what it contains and what that represents.

  11. #11

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    6

    Re: Windows media

    i looked in the settings of media player not in the code

  12. #12
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Windows media

    Quote Originally Posted by themarwik View Post
    i looked in the settings of media player not in the code
    I don't really know how that is supposed to help.

  13. #13
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Windows media

    Since he said he changed from using CurrentPosition to CurrentPositionString in post #7 and the issue was resolved there isn't a lot of reason to care what type CurrentPosition is. The whole reason they provide CurrentPositionString is so you don't have to convert CurrentPosition into a formatted string yourself, CurrentPositionString already gives you HH:MM:SS.

    themarwik, you should mark the thread resolved. There is an option to do that at the start of the thread.

    For the record, CurrentPosition is a Single.
    Last edited by passel; Oct 18th, 2017 at 08:48 AM.

  14. #14
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Windows media

    Quote Originally Posted by passel View Post
    Since he said he changed from using CurrentPosition to CurrentPositionString in post #7 and the issue was resolved there isn't a lot of reason to care what type CurrentPosition is.
    That's not what post #7 said originally. It was edited two minutes after I had already posted my next reply and I never looked back at it to see that it had changed. This is an example of why editing of posts should not be used like that. If a new post had been added instead then significant confusion could have been avoided.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width