|
array all the way
well i was thinking u have a textbox then when u click the button it will add the integer(number) to a listbox and to a arrayLIST (list is important)..the we will have a caculating button....and it will take all in the array list and average it out.
do u have aol aim or msn address? it will be easier to explain then back and forth on a form.
|
|
|
|
|
ok
owenguy22 on aol or aim
|
|
|
|
|
|
|
First, I know nothing of any games that have a batting average, you should assume that people don't know this. I am assuming you are talking about baseball, but I don't know the game.
Anonymous wrote:
'Step through the array and add the values
For i = 0 To strPlateAppearance.Length - 1
total += strPlateAppearance(i)
Next
'Divide by the number of elements in
You don't say what strPlateAppearance is? Where is outcome in the calculation? Where does total come from?
You really need to provide all the relevant code.
Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
|
|
|
|
|
that's true...I didn't provide that and I shouldn't assume everyone knows baseball either.
Plate appearance will have an impact on batting average either hit, miss or n/a
in example a test case of "single" double" "strike out"
the function should return 2/3 = .666
and "walk" "double" and "stike out"
it should return 1/2 = .5
basically a user interface that ties everything together
A function and form module
|
|
|
|
|
ouch lol ...so a triple and a homerun and a strike out will equal somethin else lol
|
|
|
|
|
display txt in a picture box? or another way
OpenFileDialog1.Filter = "Textfiles (*.txt)|*.txt"
If(OpenFileDialog1.ShowDialog()) = DialogResults.OK Then
//i'm a attepting this wrong? Or can i use pictureBox?
|
|
|
|
|
i'm not sure exactly what you want to do...
do you want to display a list of text files from a particular directory to the user? the optimal way to do this is think would be to use a list box and just query directly into the filesystem for a list of files (with a filter for text files). Then add the results into your listbox.
am i mis-understanding you?
-jim
|
|
|
|
|
hey jim,
yes it was unclear what i was trying to say before...it is very simple def. for one who has been doing VB for a long time. I just want to view a Txt File in a picture box. To see what the txt file has written in it.. clearer?? hmmmmm......say if i had gg.txt on my desktop...now in my program i want to view that txt file, and what it says(its value). I Know how to view a imgage ,but not a txt file and a animation file(flash).
*also do u know how to Run a flash animation in a VB form?*
*i get lost with some programming terms, i am learning stuff on my own soo i am just gaining knowledge.*
|
|
|
|
|
WartHog000 wrote:
clearer??
much, thanks. typically you would use a textbox to display the contents of a text file. you use a filestream to get a handle for the actual file you want to open, then use a streamreader object to extract it's contents. something like below...
Dim fileSelector As FileDialog
If (fileSelector.ShowDialog = DialogResult.OK) Then
Dim strmSelectedFile As New IO.FileStream(fileSelector.FileName, IO.FileMode.Open)
Dim strmReadFile As New IO.StreamReader(strmSelectedFile)
Me.txtFindItem.Text = strmReadFile.ReadToEnd
End If
of course you can set the filter and initialdirectory properties of the fileDialog in order to determine where to look and what to look for.
WartHog000 wrote:
also do u know how to Run a flash animation in a VB form?
you would need some sort of a flash host control for development. i would think if you have flash installed (a developer version, not the flash player) there would be some sort of .net or com component for hosting flash files, but i'll let someone with more flash experience handle giving you advice on that...
hope this helps.
-jim
|
|
|
|
|
ahh ic....yes that will help alot. thanks a bunch.
|
|
|
|
|
i did the code i got this error that the FileDialog did not work?
the error has this: An unhandled exception
is fileDialog a openFileDialog???
|
|
|
|
|
i figured it out.....thanks for all the help jim
|
|
|
|
|
Why not read the text file into a string using a StreamReader and display the string in a multiline textbox.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
i get wat you are saying...multilined textbox?....is that a normal text box? or is it like a textbox that can view paragraphs from a .txt file?
|
|
|
|
|
Hi,
I've been tring to get nested repeaters to work in vb.net for a while now and I can't seem to do it. The data doesnt want to bind to the second repeater, or atleast it does bind but doesnt display. Here is the code that im using:
<%@ Import Namespace="System.Data.Odbc" %>
<%@ Import Namespace="System.Data" %>
sub Page_Load
Dim sConnString As String = "Dsn=mysqldb;" & _
"Uid=bigtone78;" & _
"Pwd="
Dim oODBCConnection As New OdbcConnection(sConnString)
Dim myInsertQuery As String = "SELECT * FROM questions"
Dim myOdbcCommand As New OdbcCommand(myInsertQuery)
myOdbcCommand.Connection = oODBCConnection
oODBCConnection.Open()
questions.DataSource= myOdbcCommand.ExecuteReader()
questions.DataBind()
myOdbcCommand.Connection.Close()
oODBCConnection.Close()
end sub
sub questions_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles questions.ItemDataBound
if e.item.itemtype = ListItemType.Item or e.item.ItemType = ListItemType.AlternatingItem then
Dim sConnString2 As String = "Dsn=mysqldb;" & _
"Uid=bigtone78;" & _
"Pwd="
Dim oODBCConnection2 As New OdbcConnection(sConnString2)
Dim SQLstring2 As String = "Select * from options"
Dim myOdbcCommand2 As New OdbcCommand(SQLstring2)
myOdbcCommand2.Connection = oODBCConnection2
oODBCConnection2.Open()
Dim myReader As OdbcDataReader = myOdbcCommand2.ExecuteReader()
Dim nestedRepeater as Repeater = e.item.FindControl("opts")
if (Not nestedrepeater Is Nothing) then
nestedRepeater.DataSource = myReader
nestedRepeater.DataBind()
end if
myOdbcCommand2.Connection.Close()
oODBCConnection2.Close()
end if
end sub
<asp:repeater id="questions" runat="server">
<headertemplate>
<itemtemplate>
<footertemplate>
id | question |
---|
<%#Container.DataItem("id")%> | <%#Container.DataItem("question")%> | | <asp:repeater id="opts" runat="server">
<headertemplate>
<itemtemplate>
<footertemplate>
<%#Container.DataItem("opt")%>
|
|
I there anyone out there smart enough to get it to work? What am I doing wrong.
|
|
|
|
|
It seems as though the forum has made swiss cheese out of my code. It put the bottom seciton on top and took out all of my web controls.... o well. I hope you can understand it anyway.
|
|
|
|
|
|
I'm still new to this and I'm not to sure about how to use the code behind. Is there anyway to do it without using one? If there isn't how do you use one.
|
|
|
|
|
You really should pick up a book on ASP.NET. It'll clear all this up including basic concepts like code-behind. Code-behind is exactly like a Windows Form. The controls and visuals are in one file and the code that manipulates them are in another, the code-behind page.
To answer your question, no, there is no way to do this without the code. There is no trick to "using" a code behind page. When you create an ASP.NET page, two files are created. One for the visuals and HTML, the .aspx file, and the code that controls them, the .aspx.vb file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I would like to use a for next loop with a Datagrid.
I have 2 grids in my form.
Dbgrid1 and Dbgrid2
In my Dbgrid1 I have 2 cols
Col1 has
2A
3B
4C
Col2 Has
10
20
30
I want to calculate the total on Col2 using For next
eg:
for i = 0 to 2
Total = Total + current(col2)
next
Then:
Insert the total in the first row of the second col of my second datagrid:
Can some one give me the code.
Tnx
|
|
|
|
|
Sounds like Homework !!!!
how are you filling the grids in the first place? a database?, from code?
Help is great only if you ask correctly
|
|
|
|
|
The grid is populated from the data table.
|
|
|
|
|
Hi all ... plz, i need a help in the tab control ...
How i can switch between the tabes without clicking on the tab header .. ??
The truth that i want to create a button, let us name it BtnNext, when click this button it switches me to the next tab ...
Thnx alot ..
|
|
|
|