Display A Rectangular Array?
Aug 2, 2011I'm trying to do a tic-tac-toe console application for practice. I created a case statement for the user to pick which square they want to fill in. [code]...
View 1 RepliesI'm trying to do a tic-tac-toe console application for practice. I created a case statement for the user to pick which square they want to fill in. [code]...
View 1 RepliesIn a rectangular array which is correct or considered standard? dim array(row,column) as..or dim array(column,row) as. Not sure it actually matters outside of how it looks in your head.
View 4 RepliesI'm working on a reporting section of code for an inventory app I'm making for my office.I call a text file, read every line into an array then populate information pages with what has been pulled from the text file.For reporting, I want to read every text file in the directory, reading each one into a multidimensional array.Thus I can call and report on each item, i.e.ItemArray(i,2) would be all systems with Windows 2008 EE..I have code that lists all files in the desired directory and counts each file, so I eventually get counts of how deep I need the first level of the jagged array to be. but not until after code execution. Basically how can I write each array of data to the jagged array.[code]But I get a null reference exception. "Use the new keyword to create an object instance".
View 8 RepliesI need some constant arrays to be ported like this one:
[3] - first dimension
[2] - dimensions in each first dimension
[3] size of string array is needed in the language i'm porting from, y - 0, o - 1, \0 - 2 = 3 new RevTable[3][2][3] =
[Code]...
i read data from a textfile into a one dimensional array (string()) and refer to that later on to build a new list with just the lines i want. using chartData as New List (of String) I can load the List collection just fine. Now, I want to send the output to a table so I can bind it to a datagrid. using Split and AddRange breaks the one dimensional data up into new rows but I want this sort of thing:
"Row0 Cell0"->"Row0 Cell1 "->"Row0 Cell3";<line break>
"Row1 Cell0""Row1 Cell1"Row1 Cell3;<line break>
Note I provided for characters that can be used in a split function (-> and vbTab), which works, but the split in the List gives me a one dimensional array.
I have to search within an array and display the number of occurrences that a value within the array appears. I know that my code is incorrect but this is what I have so far. If anyone can point out what I am doing wrong that would be great.
Private Sub btnResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResult.Click
Dim intSearchAmount As Integer
Dim intCounter As Integer
Dim intIndex As Integer
[code].....
I'm making a non-rectangular UI and I've tried different approaches but still can't get the results I want. The following codes are for the user to move the form around.
[Code]....
I would like to draw a rectangular outside the form using mouse position but so far, I only found out how to draw rectangular inside the form.
View 12 RepliesI'm currently using the following code to take a screenshot of my desktop:
Dim r As Rectangle = Screen.PrimaryScreen.WorkingArea
Dim bmp As New Bitmap(r.Width, r.Height)
Dim g As Graphics = Graphics.FromImage(bmp)
[code].....
I'd like some direction in taking a screenshot of just a specific area. The area I need is where the rectangle encapsulates. If 've played around with it for a while tyring to figure out how to just take a screenshot of the rectangular area, but can't seem to figure it out.
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
Label5.Text = "X:" & e.X
Label6.Text = "Y:" & e.Y
End Sub
Dim objectrect As Rectangle = rects(0)
Dim object_x As Integer = objectrect.X
Dim object_y As Integer = objectrect.Y
Label7.Text = object_x
Label8.Text = object_y
I discovered that these labels are not the same, the mouse move is more accurate. My mouse is currently pointing at the upper left corner of rectangular.
This is code i am applying for Draw a Rectangular on Form..same logic i applied for Panel it's not work..
[Code]...
I have a form that allows me to drag and drop pictures but I want it to check if the object is in the correct location
*curpic = the current picture that has been selected
If curpic.location.X > bx1.Location.X And curpic.location.Y > bx1.Location.Y Then
If curpic.location.X < bx1.Location.X + bx1.Width And curpic.location.Y < bx1.Location.Y +
[code].....
Is it possible to make a picturebox that is not rectangular? Such as a circle?
View 1 RepliesI'm trying to make a program where three race cars move around a track. with randomizers and timers, I only want to do one lap. My "cars" are pictureboxes. so the starting line's location is (400, 150). Here's the coding for the inside car:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TimerRight.Enabled = Not TimerRight.Enabled
[code].....
In languages like C++ and Java, it is possible to declare an array of an arbitrary size and then give it a specific size later in the code.
[Code]....
The VBA Code is
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 105.75, 54.75, 114, 65.25).Select
ActiveSheet.Shapes.AddShape(msoShapeOval, 441, 57, 117.75, 90.75).Select
For VB.Net, I tried looking the prefix for "msoShapeRectangle" or "msoShapeOval" in
Microsoft.Office.Core.MsoShapeType. But couldn't find it.
This is a problem like the puzzle - "find minimum number of coins to completely cover a piece of paper".
The difference is:
in my case RADIUS of the coins is variable (but all coins should have same radius).
Real scenario:
1. I need to draw circular shapes on a rectangular image.
2. Number of circles (N) is CONSTANT/ User input
3. Size of image (S) is CONSTANT/ User input
4. The program should find the MINIMUM RADIUS (R) that is needed to draw N number of circles on an image of size S, so that, the image is completely hidden behind the circles.
This is NOT a puzzle/assignment that I'm trying to solve.This is part of a larger project that I'm working on.
I don't need any drawing code. I just need the code/algo to find the radius.
[code]...
If I use the exact same thing but I say txtFirstName.Text = "found", Then "found" shows up in the text box when I click the button and the first line is true.
That tells me that there is a value in .strEmployeeNumber, and it is in the *same* array as .strFirstname, so there should be a value in .strFirstName as well. But for some reason, when I click the button and the first part is true, it overlays a string.empty and clears the box instead of the First Name.
how can i display array of string,,, am using below code ,i cant display all data in f and s at same time.,below code shows error,,"Object reference not set to an instance of an object."
[Code].....
Here is some sample code:
Dim arrValue(3) as Integer
arrValue(0) = 5
arrValue(1) = 4
[code].....
This program is to display the monthly payment and amortization table for three mortgage loans with the same loan amount, but three different interest rates and terms.The ArrayIndex is not looping properly.The first loan displays correctly, but the other two only display the monthly payment and not the amortization table.[code]I originally had the For...Next loop in the DisplayAmortizationTable() sub with the Do Until loop nested in it. My instructor had me move the loop to the Main() sub, but it did not help.
View 4 Repliespublic class form 1
private dim row as integer
private num() as integer
[Code]....
<asp:GridView ID="gvNames" runat="server"
OnRowDeleting="gvNames_SelectedIndexChanged"
AllowSorting="true"
[Code].....
I have an array of info with each element containing a structured variable. Once the array is full of info it is passed to a procedure "DisplayStructure" which I'm trying to get display a MessageBox with the info in it, separating each element on a separate line. I can't get it to display even one element on one line. The structure is called Employee and what comes up in the MessageBox is Employee.Example or Example.Employee, can't remember which.[code]...
View 3 RepliesI have a series of arrays each containing various info.
Is it possible to display this data into a datagrid and then sum op the totals?
Is there any way to display the full array with delimiters and everything?The code below does not work but it show you a example of hat I want to do.
Code:
Dim apa As String
Dim ar() As String
apa = "1,2,3,4,5,6"
ar = Split(apa, ",")
MsgBox(ar)
I have a form with one richtextbox and one button. The idea is that:
Form Load: data read from text file into arrayButton Click: random number generated, then used to select the string whose index number matches the random number generated
My StreamReader is working correctly and I can create random numbers with no problem, but I'm stuck on how I can use this random number to extract the corresponding string. I keep get the error saying QuoteObject reference not set to an instance of an object.
My code is below:
Imports System.IO
Public Class Form1
Dim questions(69) As String
Dim i As Integer
[Code] .....
in VB 2010 how do I display the contents of a 2 dimensiomal array. As a VB6'er, I miss the flex grid control and I can't seem to adapt to the Data Grid view for displaying array data.
View 13 RepliesI have a dynamic array that holds my results. I want this result to display on a form as an equation.The results from my array are numerical numbers and I want them to be multiplied to column headers of my datagridview.Column header for my datagridview are X1, X2, X3, X1^2, X2^2, X3^2, X1X2,X1X3,X2X3.My array is of the size 9.The values in my array could be , 23, -7.19, -26, -78, 32.5, .89, 21, -2.3, 4.5, 6.7..I am just making my results display on a msgbox one by one but I cannot get all of them once.
View 1 RepliesMy button won't display the information my arrays are holding. why it won't show the information that is stored in the arrays... It shows only 'blanks' I don't understand!!!
Public Class frmMain
Dim intCount As Integer
Dim nmlStudents(49) As Namelist
[Code].....