|
That smells like homework to me. Google 'variables VB.NET'.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I would like to create a dataset that indicates whether co-ordinates on a grid are occupied. How do I set the composite primary key to be made up of xPosition and yPosition?
Then I need to populate the values with 'false' initially and mark them as true through a function. How do I populate the values?
Is the size of the dataset incremented automatically as I increment the values or do I have to do it explicitly?
Public Class Plateau
...
Private Sub initDataSource()
'Create PlateauPostions
'define attributes
With plateauPositions
.Columns.Add("xPosition", System.Type.GetType("system.int32"))
.Columns.Add("yPosition", System.Type.GetType("system.int32"))
.Columns.Add("occupied", System.Type.GetType("System.boolean"))
End With
'enforce composite primary key on xPosition and yPosition
... ??
End Sub
Jon
|
|
|
|
|
I have a problem using the picturebox. i am creating a game and i am using my character as a picturebox. i am moving him using the (w - a - s - d) format. now .. when i am pressing the "D" .. the code is doing this:
picSnake.Location = new point(picsnake.location.x + 4, picsnake.location.y).
Now the problem is this: the snake is moving to the right as it is suppose. but the problem is this that the picture is refreshing itself and when i am pressing the "D" and keep the "D" pressed all the time, the picture is like erasing itself and then it comes back again and goes to the right because the "D" is pressed. how can i solve this problem?? its very ugly right now
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
You can't do this with a picturebox and expect it to work nicely. You should draw the image direct to screen, or, unless the game is simple, look in to DirectX.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
can i use directx using vb.net??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Of course - just download the SDK and it should install managed DX automatically.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Is there an easy way to alternate forecolors in a listbox simular to datagrids in vb.net ???
silver-gray
|
|
|
|
|
Silver-Grey wrote: Is there an easy way
What's easy for us may not be easy for you.
There is no support for this built into the ListBox control, so you'd either have to find a replacement control that supports this, or create your own ListBox control and ownerdraw the ListBox to get this effect.
Since you'd have to supply the Fore/BackColor's for the even and odd rows, you'd probably want to start by creating your own ListBox class so you can expose these properties. You can Google for "ownerdraw listbox vb[^] for examples.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
vb.net
i'm dynamically adding buttons to my form and to these buttons adding the same sub to be handled which shows a messagebox, that should show the number of the button.
see example:
<br />
public cmd as button<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Dim i As Integer = 1<br />
Dim z As Integer = 5<br />
Dim x As Integer = 10<br />
Dim y As Integer = 10<br />
<br />
For i = 1 To z<br />
cmd = New Button<br />
cmd.Width = 100<br />
cmd.Height = 40<br />
cmd.Left = x<br />
cmd.Top = y<br />
Me.Controls.Add(cmd)<br />
AddHandler cmd.Click, AddressOf show_messagebox<br />
x += cmd.Width + 5<br />
Next i<br />
<br />
End Sub<br />
<br />
Private Sub show_messagebox(ByVal sender As System.Object, ByVal e As System.EventArgs)<br />
MsgBox("button ") ' + a number indicating what button has been clicked<br />
End Sub<br />
<br />
how can i find out, which button has been clicked?
this example uses only a few buttons, but i need to differentiate between up to several hundreds.
|
|
|
|
|
The sender parameter is a reference to the button that has been clicked.
---
b { font-weight: normal; }
|
|
|
|
|
yes, i know that, but i dont know how to use that.
|
|
|
|
|
Cast the reference to Button , then you can reference it's properties:
Button button = DirectCast(sender, Button);
---
b { font-weight: normal; }
|
|
|
|
|
hello, my question is this. i've been wondering how do i show the list of services running in a machine, through vb.net? and i'm not getting anything usable while i search google.
any help would be appreciated.
thanks in advance
|
|
|
|
|
You're looking for the ServiceController[^] class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
that's it, thanks for the help
and can anyone help in some way, how to "see" the instances of msde using vb.net?
any help would be appreciated
-- modified at 13:05 Friday 29th September, 2006
|
|
|
|
|
I would like to play a beep with a particular lenght in milliseconds. How to do this in VB.net? Is there a way to play the beep with soundcard and not with PC Speaker (the beep function would instead call a wav/mid file and adjust its length according to the target length)?
All help is welcome!
|
|
|
|
|
Which version of VB.NET? In 2005, you have the <a href="http://msdn2.microsoft.com/en-us/library/081ed2x7.aspx">My.Computer.Audio</a>[<a href="http://msdn2.microsoft.com/en-us/library/081ed2x7.aspx" target="_blank" title="New Window">^</a>] object that will do something like this.
There is no method or function call to resample a wave file and strech/compress it to play in x number of milliseconds. You'll have to find a library to do this for you. I don't know of any off the top of my head.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Is there a way to generate a sine wave sound with a particular frequency?
|
|
|
|
|
|
|
use int.TryParse to turn your string into a number, and ToString to turn the result back into a string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Does google not work where you are ? I gave you all the keywords you needed to find what you wanted.
dim i as int
if int.tryparse(textbox1.text, i out) then
i += 27
textbox2.text = i.tostring()
end if
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
man can you chat me online at yahoo!???
|
|
|
|
|
This is my select statement
Dim mySelectQuery As String = "Select id,ClosedDate,Status,RecvdDate,SUrgent,EValue,GroupName,owner,CallDesc From vwHeat where recvddate >='" & startDate & "' and GroupName ='" & ListBox1.SelectedItem & "'"
In my database,some data in CallDesc in not in the same line eg.
My name is Rigard.
My surname is Mossi.
I write all the above data in a .cvs file.
I want this to appear as :
My name is Rigard. My surname is Mossi. in one line.
But when it get to my .csv file, it writes "My name is Rigard" in one line and "My surname is Mossi in the nest line"
How can I make this to be in one line in my .csv file?
|
|
|
|