|
How can i make a new form showing the positions of each racer (descending order), i have no idea how to do this as it is all new to me. My existing program is below:
http://www.angelfire.com/mech/harrysk/Assign1_Race.zip[^]
I want the race results after the race has finished, showing the Positions (descending), Name and Distance that they have travelled. Thanks in advance.
|
|
|
|
|
Have a crack at it, then we'll help on the specifics if you get stuck, rather than just writing your program for you.
|
|
|
|
|
This reeks of homework...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Not very clever, adding a link to a site that says explicitly Angelfire does not allow direct linking
from offsite, non-Angelfire pages, to files hosted on Angelfire..
Oh yes, Assign1_Race? The point of assignments is to put into practice what you learn't in the lessons, so you may find life easier if you pay attention to your teacher!
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
i have mdiform and i want when user open new form i close the old on i used vb6
|
|
|
|
|
I have created race game application (see project attachment: open zip file below), first off sometimes it works sometimes it doesn't, when it does work some problems still occur. The problems i am facing are:
1. why does it not change the rate of the accelelration, deceleration of each contestant when i enter it into their text boxes? (refer to project code-below)
2. when i click on restart and try to run it again all the vehicles disappear???
3. the cars already have default values (all different) so why do they run at the same speed, rate etc. (they all move at the same speed in a row, this always changes with the timer interval i enter into a text box, why?)
4. When i click on the start button the vehicles go out of the screen (down) and start to come up (start the race to see)
There may be more minor problems but i'll post them later if i have time (i got till the morining of 17th, so could someone please reply soon.) I need help on these small problems. Thanks.
Click on this link to download the project (zipped)
http://www.angelfire.com/mech/harrysk/Assign1_Race.zip[^]
|
|
|
|
|
Thought it smelt like homework, see next posting, same applies.
|
|
|
|
|
This may be possible through the windows registry but I don't have a clue on how to fetch those strings/value in hierarchal way.
|
|
|
|
|
Hiya.
Got an easy question here I think
Is it possible to pass an Array into a function withouth having to "dim" the array before hand.
For instance something like this:
Public Function Name(byval inputArray as string())
//some code
End Function
Now if I were to call that function I'd dim the array and assign the values:
dim objArray as String() = {"value", "value" ... "value"}
and then call the function:
Name(objArray)
However - what I'd really like to call the function similar as this:
Name( {"value", "value", ... , "value" } )
That is calling the function withouth having to dim the array.
Is there anyway something similar is possible?
Yes - I know it is a few lines of codes, but I'd still like to know.´
With regards
Alsvha
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
No it's not. You must Dim the variable first, otherwise VB will not know how to pass the variable to the function. Also, If your going to return values in the variable you pass in the function parameters, you must pass it ByRef, not ByVal.
Dim inputArray As String()
MyFunction(inputArray)
.
.
.
Public Sub MyFunction(ByRef ia As String())
ReDim ia(someNumber)
End Sub
Or, you could do it as a return value from a Function:
Dim inputArray As String()
inputArray = MyFunction(someValue)
.
.
.
Public Function MyFunction(ByVal value) As String()
Dim ia As String()
Return ia
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
As said in the other post, you probably want to pass the parameter by Ref or return a value.
However it is possible to call a function or sub with the array declaration inline, as it were.
MyFunction(New Object() {Object1, Object2, Object3})
Another method that I prefer is to use a ParamArray as the parameter. This would give the following.
Public Sub MyMethod(ByVal ParamArray args() As Object)
' Do Stuff
End Sub
...
MyMethod(Object1, Object2, Object3)
Using this style you can pass the elements of the array as if they were parameters, and it still acts like an array.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
Is there a way that one can call a web service asynchonously (from a windows application, for example), be able to continue processing user input whilst waiting for the web service response, and be able to specify a timeout? I have previously used asyncCallBack, which allows an application to carry on working whilst waiting for the response from a web service, but it doesn't allow one to specify a timeout. One can use waitHandles, but I don't believe they offer that same flexibilty for the processing the application can carry out whilst it awaits a response. Any ideas?
|
|
|
|
|
|
Thanks, I'll have a look.
|
|
|
|
|
I Had an xml file that had a table in it.table0
I have recently added another. table1.
now when I run my program it says there are multiple root elements Line 10,position 2. does this mean i need to use SQL. if so or if not can someone type some sample code that would stop the root element problem. If you need to see my code I have another thread posted under datagrid/xmlfile that i posted yesterday and is on the next page.
|
|
|
|
|
The clue is in the error... i am guessing your original file was something like this:
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
Now i am guessing that you have a second table it looks something like this:
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
The problem is the two Table nodes in the root, therefore you need to put in a single root element:
<Tables>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
</Tables>
Hope this helps
Tom
|
|
|
|
|
I want to prompt user for internet connection wizard if he is not connected.
how it can be done?
|
|
|
|
|
hi,
I have to develop a ftp client using VB.Net and infragistics control. I want to get sample code for this.
Your help in this regard will be greatly appreciated.
Thanks and regards.
Zubair.
|
|
|
|
|
Well, you haven't given us any details with what you need help with. If your just trying to find example code to modify and call your own, then Google for it -> Google results on "FTP Infragistics example"[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to capture the start time and the pause time of the video clip from the windows media player that we have designed in vb.net.
suppose the duration of the video file is 4 min 36 secs then by using
axmediaplayer.duration method we get the durations in seconds, which is greater than the time specified ,
I want to know how to capture when the time when the user has done the following operations on clip like
play ,
stop,
Pause
|
|
|
|
|
I think your looking for Player.Controls.currentPosition. But when the user clicks Stop, the position will be 0, no the position when Stop was clicked.
You can find the docs on the Media Player Objects here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I workaround for Type Mismatch 13 error?
Seemslike application crush when this error generated.
I want to avoid it.
Thanks in advance.
Shin
|
|
|
|
|
Can you post the code that is causing the error?
|
|
|
|
|
Without seeing the code that generated the error, there is nothing we can tell you. Type Mismatch can be generated by so many things it's impossible to determine what went wrong without seeing the code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do you add BMPs to a PopupMenu? I tried doing the same thing you do for standard menus and this does not work. Any ideas?
[code]
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function GetMenuItemInfo Lib "user32" Alias "GetMenuItemInfoA" (ByVal hMenu As Long, ByVal un As Long, ByVal b As Boolean, IpMenuItemInfo As MENUITEMINFO) As Boolean
Private Type MENUITEMINFO
cbSize As Long
fMask As Long
fState As Long
wID As Long
hSubMenu As Long
hbmpChecked As Long
hbmpUnchecked As Long
dwItemData As Long
dwTypeData As String
cch As Long
End Type
Private Const MIIM_ID = &H2
Private Const MIIM_TYPE = &H10
Private Const MFT_STRING = &H0&
Private Const MF_BITMAP = &H0&
Dim hMenu As Long, hSubMenu As Long, hID As Long
'Get the Menuhandle of the form
hMenu = GetMenu(frmMain.hwnd)
'Get the handle of the PopupMenu submenu
hSubMenu = GetSubMenu(hMenu, 0)
hID = GetMenuItemID(hSubMenu, 0)
SetMenuItemBitmaps hMenu, hID, MF_BITMAP, imgMenuItem(0).Picture, imgMenuItem(0).Picture
hID = GetMenuItemID(hSubMenu, 1)
SetMenuItemBitmaps hMenu, hID, MF_BITMAP, imgMenuItem(0).Picture, imgMenuItem(0).Picture
hID = GetMenuItemID(hSubMenu, 2)
SetMenuItemBitmaps hMenu, hID, MF_BITMAP, imgMenuItem(1).Picture, imgMenuItem(1).Picture
[/code]
Thanks,
Tim
|
|
|
|
|