VS 2010 Current Position And Duration?
Apr 20, 2010Imagine that I have a timer checking the current position, and always checking if it is equal to the duration of the sound.
View 13 RepliesImagine that I have a timer checking the current position, and always checking if it is equal to the duration of the sound.
View 13 RepliesWell, How can I click the mouse at it's current position in Visual Basic .NET 2010?
View 9 RepliesI am using VB 2008. I am trying to use the currentMedia.durationString to get a tracks lenght like shown below:
Label1.Text = AxWindowsMediaPlayer1.currentMedia.durationString
I have a problem that this does not work until a file has started playing. If i start a track and then stop it, then load a different track it works perfectly but it never just works first time.
In VB.NET 2005. i am trying to experiment with sound. I started out trying to produce a single note at a single left-right position, for a particular duration (maybe until i shut it off. with a particular frequency.It can be a sine wave, or a square wave or maybe a general midi sound. This seems to me to be a simple task, but i cannot find out how to do this.I suspect that the answer lies inside direct sound or xaudio2. I want a simple solution i don't want to have to spend 1600 hours learning xaudio2 in order to learn how to how to make a beep.The ideal answer wold be for me to write a routine that accepts waveshape,freq,volume,Stereo_Position,duration).
View 4 RepliesIn winform's textbox, how to get the current key-in position?
For example -
textbox.text = 3056.98
If I type '7' after '0', current key-in position is 3.
In vb.net, which textbox event or keyword could I get this position value?
I am trying to develop a HANGMAN game and i need to implement a button where the user can click on it to "buy" letters. So, i designated 2 text boxes (one visible containing stars and another one not visible containing the word that should be guessed), and i wrote the following piece of code so that once the user presses the button any of the stars will turn to the correct letter. My question is, i found the index of "*" and removed it, and now i want to insert the corresponding char with this index (WordInLetters). How can i find what char is at index "index" in vb.net?
Private Sub picBuyLetters_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picBuyLetters.Click
Dim index As Integer = txtWordinStars.Text.IndexOf("*")
[Code].....
How do I get the current write-position using the BinaryWriter. I need to store the position in order to read from that position afterwards. (I know it would give the position where the next write would start, that will be taken care of).
View 2 RepliesPrivate Sub Button7_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button7.Click
[Code]...
oook so this when button7 clicked it will move my mouse to the X:700 and Y:700, but will start from the X:0 and Y:0 but i tried making start from my current mouse position but idk how not working:
i have a for loop "for each val in values" I want to within this loop some how check positions ahead of the current position for a condition. I am unsure how i can do this however apart from having an inner for loop to loop from the current position. If that is the case I am not sure how i can get the current position.I have attempted this with this code below, the inner for loop.
If creditPoints = "10" Then
Dim valcount As Integer = Val.Count
For intLoopIndex = valcount To Values.Cou
[code].....
How would I get the current mouse position?
View 2 RepliesI have been searching around and trying to figure out how to get media, specifically videos, length/duration.I know that you can use the Windows Media Player object to achieve this, however, I need to get the duration of some media that is not supported by windows media player.I am developing my own media player in VS 2010 that will be utilizing the VLC media player component since VLC is able to play most (if not all) media formats. So far I have tried playing around with "My.Computer.FileSystem.GetFileInfo("path").length" but all this gets is the media's length in Bytes. What I am trying to achieve is the format of hh:mm:ss for pretty much every format, not just Windows Media Formats, but real media, .mkv, etc.
View 5 RepliesBindingsource.position/current. after data been updated
View 8 Replieshow can i get the current position of the cursor in real time inside a picturebox?
View 2 RepliesI'm trying to create a hook to monitor the current position of the mouse cursor. Nothing important, I just need to count some pixels during interface design and wanted to learn how to create a hook, so I decided to go for a hard way instead of a sane way.
I've found example code which declares the following function:
<DllImport("User32.dll", CharSet:=CharSet.Auto, _
CallingConvention:=CallingConvention.StdCall)> _
Public Overloads Shared Function SetWindowsHookEx _
[Code].....
But Appdomain.GetCurrentThreadID generates the warning: "'Public Shared Function GetCurrentThreadId() As Integer' is obsolete: 'AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread."
I've tried using ManagedThreadID, but that doesn't work. The thread ID returned seems to be the logical thread ID of the thread, as it runs in the .net runtime, rather than the Win32 thread identifier.
Calling the function ith AppDomain.GetCurrentThreadID works, but I really would like to have a "stable identifier" for my thread.
Can someone explain to me whether it is possible to use ManagedThreadID in this context (I assume not) and, if not, the things I need to avoid in order to stop the AppDomain.CurrentThreadID from becoming "unstable"?
I want a proper hh:mm:ss formatted duration, but I cant seem to get it right. I have ran through a good dozen attempts and things just arent working.
timer
Public dtStartTime As DateTime
Public tsElapseTime As TimeSpan
Public Sub tmrStartTime()
[code]....
Calling tmrStartTime sets the start of the timer, and tmrGetTimeSpan should report back the proper hh:mm:ss. For example, 11 elapsed seconds should look like 00:00:11, or 65 elapsed seconds should look like 00:01:05.
I'm using VB 2010 Express with two instance of AxWindowsMediaPlayer in order to sync two videos (the videos are of the same thing but from two camera angles). Because the videos were started at slightly different times I've manually set the start time of each one using the following
AxWindowsMediaPlayer1.Ctlcontrols.currentPosition = 314.5093196
AxWindowsMediaPlayer2.Ctlcontrols.currentPosition = 237.1639908
The problem I'm having is that whilst the WMP clock initially displays the above times in each AxWindowsMediaPlayer, when I play the videos each starts a few seconds out from the stated currentPositions.
The video files are around 300MB each and when testing with smaller video files the problem does not seem to happen. I'm guessing the large file size is causing some delay and hence causing the problem.
On one of my forms i have a datagridview binded to an Access database. It displays only first and last names of my customers in a datagridview.What i want to do now is, when i double-click on one of the customers another form will open and display details for this customer (detailed view - textboxes).
What i have accomplished so far is that when i double-click on a customer in datagridview a form opens with details (linked to the same binding source as datagridview). But the problem is that it always opens the first record even if i dobule-click second or third in datagridview.I don't know how to bind these textboxes with current datagridview position?
In our VB6 applications, we added a few utility functions for tracking the amount of time spent in a function. We did this to track performance bottlenecks. Basically, how it worked was there were two utility functions:
StartTickCount() and EndTickCount().
You would pass the name of the function in each, and the functions would use a dictionary to get the tick count when StartTickCount() was called, and then subtract the tick count when EndTickCount() was called. This wasn't perfect because it didn't of course take into consideration that calls to get tick count takes time, etc, but basically it worked for our purposes. How to make sure to call StartTickCount() at the beginning of each function and EndTickCount() at each exit point:
Private Function SomeFuction() as String
' indicate the function started
StartTickCount("MyClass.SomeFunction")
' some logic that causes the function to end
[Code] .....
Anyway, is there any functionality built in, either through the VS 2010 debugger or in the System.Reflection namespace, to do something similar in VB.NET? Basically, what I want is to log the number of times each function is called, the total amount to time spent in that function, the average number of seconds spent in that function, and the maximum amount of time spent in a single call in that function.
Without using TopIndex, EnsureVisible, etc., is there a way to simply save the current scroll position of a listivew as a point, then reset the scroll position to that point after reolading the listview?
View 3 Repliesi have this little problem that i cannot get my gead around
i am loading list view from a table then checking if a specific column value in that table when i load the list view from the table everything works fine but when i ask the ds to give me a specific value out of the table i get error
there is not row at location 0
here is my code
Try
Dim dt As DateTime = (DriverRoster.lvViewRoster.SelectedItems(0).SubItems(0).Text)
'Dim culture As New System.Globalization.CultureInfo("en-AU")
[Code]......
I'm trying to set a new cursor position but I get this error:
A call to PInvoke function 'mon! WindowsApplication1.Form1::SetCursorPos' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
Here is the code:
Declare Function SetCursorPos Lib "user32" _
(ByVal x As Long, ByVal y As Long) As Long
SetCursorPos(457, 603)
It used to work when I used VS 08 but now I use VS 10 and this problem has started to appear.
I am trying to get a character from a rich text box based on two variables (one for the x coord and one for the y coord. Everything I've tried so far has lead to errors. The get char from position option returns something about not being a part of system.draw... something
View 3 RepliesIs there some way of setting anther process's position? Lets say we had our vb program up and you click a button, could this button set the position of Google Chrome to the top left corner?
View 1 RepliesI am trying to get top position and the size from a program with vb 2010, but it wont work.
Option Explicit On
Option Strict On
Imports System.Runtime.InteropServices
Public Class Form1
[code]...
I have a form in Visual Basic, and the size of the form is: 211, 49. And when the form Loads, It loads to the top / left of the screen. the form has no border. How can I get my form to load top / right of the screen.
I Have tried changing the properties, Start Position to Manual, And then changed Location 0,0. but what if someone has a different size screen than mine.
I know how to get the cursor position but how do I add a character to that position. Like I want to have a button that adds a specific character at the position of the cursor.
I don't see any richtextbox properties that allow me to add anything at the cursor position.
If TypeOf Me.ActiveControl Is RichTextBox Then
Me.ActiveControl.SelectedText = Chr(176)
End If
I use this code to start VLC player:
vlc = Process.Start("C:Program Files (x86)VideoLANVLCvlc.exe", "--fullscreen """ + bestand + "")
IT just start's correctly, only 1 problem. Sometimes it starts on my second monitor. I need it to alway's start on my main monitor. How can i change the position of VLC?
I want to find the size and position of a window from another application. I already have the window handle, how can i do this?
View 2 RepliesI have a photo(Img1.bmp) with drawing of my book library.Each area on image (A1, A2, ...) have books. url...I like when i put my mouse in a specific area on image (Img1.bmp) and licking this area (eg B1 or C2 or ...) identify this area.
View 15 RepliesI have a user control where in the user control that there are 3 other controls for the PictureBox, button1 and button2.for the PictureBox control I want to resize when the user control in he will change length and width.button1 and button2 whereas only change in the position left alone.I include the following examples in resize images before and after.
View 3 Replies