|
|
i'm doing a dice function which user click on the button then the dice will start rolling a while then it stop itself. i only able to make it random dice, but there is some problem when it stop casue after it stop it cannot perfomr my next action.Anyone pls correct my mistake ? :
---when user click on the button
Private Sub Dice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dice.Click
DiceTime.Enabled = True
movepiece()
End Sub
-----run tis when DiceTime.enabled=True
Private Sub DiceTime_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DiceTime.Tick
'Randomly pick a number from 1 to 6
Dim z, y, bc As Integer
Randomize(bc)
For z = 1 To 6
dicelabel.Visible = True
Next
y = (Int(Rnd() * 6) + 1)
dicelabel.Text = y
BTime.Enabled = True
End Sub
---- plan to stop it after the dice rolling a while
Private Sub BTime_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTime.Tick
DiceTime.Enabled = False
End Sub
|
|
|
|
|
Move BTime.Enabled = True out of the DiceTime_Tick() method and into your Dice_Click() method. This will help reduce the chance of bugs by ensuring this timer is only started at the start of a dice roll.
Add BTime.Enabled = False to your BTime_Tick() method.
This is why it's not working for you. This timer was still running and was turning off your DiceTimer.
|
|
|
|
|
I have a windows application that has been developed in VB.NET 2003. As part of this application I have included a help (chm) file that can be called from the main application menu, or using F1 on one of the data entry screens.
I am having a small issue in navigating within the help file when calling it from F1. Here is an example of the code I have implemented:
Private help As New HelpProvider
help.HelpNamespace = Application.StartupPath & "\HelpFileName.chm"
help.SetHelpKeyword(Me, "PageName.htm")
help.SetHelpNavigator(Me, HelpNavigator.Topic)
When I click F1 from a data entry screen, the help file is loaded and the correct page is displayed. The problem I have is that the Contents page is still show the first icon and does not navidate to the correct page marker. Therefore the user cannot see the location of the displayed page in the contents panel.
Is there any way of getting the contents page to also navigate to the page name for the specific page that is being displayed so the user can see where they are.
Thanks
Jason
|
|
|
|
|
how can i count the total no of row in datagrid vb.net
asdf
|
|
|
|
|
|
kostasdiktia2 wrote: DataGrid1.RowCount
buth -1
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
Hi: help code program play sound wav from path "C:\dicsound\sound\..."soundfilename" by SELECT * From diccom ORDER BY id_dic ASC
///////////////////////////////////////////////////////////////////////
Private Sub ShowPostion()
'Dim Oledr As OleDbDataReader
Dim oleCmd As OleDbCommand
Dim sqlTmp As String
Dim box As New PictureBox
sqlTmp = "SELECT * From diccom ORDER BY id_dic ASC"
Cursor.Current = Cursors.WaitCursor
With Conn
If .State = ConnectionState.Open Then .Close()
.ConnectionString = strConn
.Open()
End With
oleCmd = New OleDbCommand
daPro = New OleDbDataAdapter(sqlTmp, Conn)
daPro.Fill(ds, "testdic")
TextBox1.Text = (ds.Tables("testdic").Rows(0).Item("id_dic"))
TextBox2.Text = (ds.Tables("testdic").Rows(0).Item("read_dic"))
TextBox3.Text = (ds.Tables("testdic").Rows(0).Item("sub_dic"))
TextBox4.Text = (ds.Tables("testdic").Rows(0).Item("content_dic"))
TextBox5.Text = (ds.Tables("testdic").Rows(0).Item("sample_dic"))
soundbox.Text = (ds.Tables("testdic").Rows(0).Item("soundFilename"))
Conn.Close()
asp dropdownlist for access
|
|
|
|
|
por favor alguien puede decirme como cuando pongo el puntero del mouse sobre un grafico(o sea un Graphics que esta dibujado sobre un PictureBox) puedo tomar las Coordenadas X y Y del grafico donde esta el puntero?
Gracias
|
|
|
|
|
Babelfish translation for those who can possibly help...
please somebody can say to me like when I put the leader of mouse on grafico(o is a Graphics that this drawn on a PictureBox) I can take Coordinates X and and of the grafico where this the leader?<br />
<br />
Thanks.
Please post in english if possible.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
-- modified at 0:48 Thursday 9th March, 2006
|
|
|
|
|
Somthing like this...
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
Label1.Text = "X." & e.X & " " & "Y." & e.Y
End Sub
progload
|
|
|
|
|
Hi all,
I am building a online dating site (users may be 200-300 or more). each user can only store upto 5 images. my table structure looks like below
------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UserImage]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserImage]
GO
CREATE TABLE [dbo].[UserImage] (
[Bits] [image] NULL ,
[Description] [nvarchar] (300) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[UserId] [int] NULL ,
[UserImageId] [int] NULL ,
[UploadTime] [datetime] NULL ,
[ImageSize] [int] NULL ,
[Mime] [nvarchar] (300) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
------
I just want to know will it have any performance issue when i store images in DB rather than in file and only have a reference to that filename in DB?
I dont want my user to type the URL parameter and do silly stuff such as.
i only want them to type
www.mysite.com
and if they type in URL anything other than that it should take them to
a page saying page not found or sumthing. the reason is.
when i delete image i am getting a parameter from query. like
www.mysite.com/managepictures.aspx?UserId=12&DeleteImgId=4
that means if user passes diff. parameter it will actually delete others image and they can even browse the pic by chaning UserID para.
i dont know how to achieve this
please help
many thanks in forward
Robin
|
|
|
|
|
In general, storing images in a database for this purpose is probably not a good idea. Your database will grow very large over time and become unmanageable (and possibly performance will degrade too).
The better way would be to store the images in the file system and store the path to those images in the database.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
Umm.... haven't you already asked this (or a VERY similar question[^]) before????
PLEASE DON"T POST MULTIPLE TIMES.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
you didnt answer my remaining answer.
|
|
|
|
|
No, I didn't.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
so is there any solution to my answer? or shall i just pass the parameter in invisilble label and work it out? but in some cases i need parameter from client end. what should i do about that
|
|
|
|
|
hello
hello i would only to ask anyone of who can solve this problem coz i been using this code datagridview.row.clear() to add a new record but...it shows an error message which is "cannot clear the list coz its data bound" can you help me this problem.....
thanks
|
|
|
|
|
hi there!
i think istead of clearing the datagridview u should clear the dataset and then rebound the gridview.
abhinav
|
|
|
|
|
I am running a procedure in a thread which is created on the click of a button. However, the process does not complete correctly. Please refer to the code below:
Private Sub cmdProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdProcess.Click
Try
Dim tquery As Thread
tquery = New Thread(AddressOf Me.GetData)
tquery.Start()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error In cmdProcess_Click", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub GetData()
Try
Dim field1, field2, op1, period1, value1 As String
Dim m1, y1, tablename As String
period1 = Trim(cmbPeriod.Text)
m1 = Mid(Trim(period1), 5, 2)
y1 = Mid(Trim(period1), 3, 2)
tablename = "SSA" & m1 & y1
field1 = Trim(cmbField1.Text)
value1 = Trim(cmbValue.Text)
op1 = Trim(cmbOP1.Text)
field2 = Trim(cmbField2.Text)
str = "select " & Trim(op1) & "(" & Trim(field2) & ") from " & Trim(tablename) & " group by " & Trim(field1) & " order by " & Trim(field1)
ipcon.Open()
DA = New OleDbDataAdapter(str, ipcon)
DS = New DataSet
DA.Fill(DS, "qrec")
ipcon.Close()
DataGrid1.SetDataBinding(DS, "qrec")
Catch ex As Exception
MessageBox.Show(ex.Message, "Error In GetData", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
-- This code exits with the following error message 'Controls created on one thread cannot be parented to a control on a different thread'
Please guide me how to resolve this issue.
With Best Regards,
Mayur
|
|
|
|
|
Hello,
I have to create a custom control which consists of a label and an ASP.Net listbox. The control has to have a public property called 'Items' which allows users to add list items to the control's listbox during design time. (much like the Items property of the original vb listbox). I used ListItemsCollectionEditor to show the ListItems Editor window.
However, when the ListItems Editor window appeared and after adding some list items, the listbox did not display the newly added items at all.
A code snippet is given below:
<editorattribute(gettype(system.web.ui.design.webcontrols.listitemscollectioneditor), _
gettype(uitypeeditor))=""> _ //displays the ListItemEditor window
Public ReadOnly Property Items() As ListItemCollection
Get
Return listitems //listitems is a listItemCOllection variable
End Get
End Property
How do I enable the listbox to display the newly added list items?
|
|
|
|
|
Why not use Excel? It has built-in functions to do this and lots more.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
<insert snickering sound>
</insert snickering sound>
.. I was waiting for the 'we dont do homework' response from someone
'g'
|
|
|
|
|
Thanks, thats a nice quote. I don't think that i can use excel
|
|
|
|
|
Any other information will be very Helpful!!
Thanks Again
|
|
|
|