Click here to Skip to main content
15,912,400 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Publishing website and making it show Pin
§tring§urfer10-Oct-06 10:49
§tring§urfer10-Oct-06 10:49 
Questionopen File Pin
samira forooghi30-Sep-06 3:13
samira forooghi30-Sep-06 3:13 
GeneralRe: open File Pin
Guffa30-Sep-06 3:51
Guffa30-Sep-06 3:51 
QuestionFile Type Pin
samira forooghi30-Sep-06 3:07
samira forooghi30-Sep-06 3:07 
AnswerRe: File Type Pin
Dave Kreskowiak1-Oct-06 14:42
mveDave Kreskowiak1-Oct-06 14:42 
QuestionMatrix Report Pin
microuser_200030-Sep-06 2:06
microuser_200030-Sep-06 2:06 
QuestionSharing Display Pictures in Messenger Pin
freefika30-Sep-06 1:09
freefika30-Sep-06 1:09 
Questionprivate variable not retaining its value Pin
jon-8029-Sep-06 22:23
professionaljon-8029-Sep-06 22:23 
The following properties are being used within the class, however when they are called from within a private sub within the class itself, intXPositions and intYPositions show a value of zero, even when the value has been set.
public class mainForm
...
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Initialize plateau.
Dim myPlateau As Plateau = Plateau.Instance
myPlateau.XPositions = 1001 ' x = 0 to x = 1000
myPlateau.YPositions = 1001 ' y = 0 to y = 1000
dtgPositions.DataSource = myPlateau.dsPlateauPosition
dtgPositions.DataMember = "PlateauPositions"
Me.Text = "done"
End Sub
...

Public Class Plateau
...
Private intXPositions As Integer
Public Property XPositions() As Integer
Get
Return intXPositions
End Get
Set(ByVal Value As Integer)
intXPositions = Value
End Set
End Property

Private intYPositions As Integer
Public Property YPositions() As Integer
Get
Return intYPositions
End Get
Set(ByVal Value As Integer)
intYPositions = Value
End Set
End Property
...

Private Sub initDataSource()

'Create PlateauPostions, a working dataset that retains information about
'positions occupied on the grid.
Dim dtPlateauPositions As New DataTable("PlateauPositions")

'define attributes
With dtPlateauPositions
.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
Dim colPrimaryKey(1) As DataColumn
colPrimaryKey(0) = New DataColumn("xPosition")
colPrimaryKey(1) = New DataColumn("yPosition")

'create dataset
dsPlateauPosition.Tables.Add(dtPlateauPositions)

'initialize positions as not occupied
Dim rowNew As DataRow = dtPlateauPositions.NewRow()

Dim intXCount, intYCount As Integer
For intXCount = 0 To intXPositions 'value is 0 when it is expected to be 1001
For intYCount = 0 To intYPositions 'value is 0 when it is expected to be 1001

rowNew.Item("xPosition") = intXCount
rowNew.Item("yPosition") = intYCount
rowNew.Item("occupied") = False
dtPlateauPositions.Rows.Add(rowNew)

Next intYCount
Next intXCount

End Sub

...

Jon
AnswerRe: private variable not retaining its value Pin
Guffa29-Sep-06 23:08
Guffa29-Sep-06 23:08 
QuestionRe: private variable not retaining its value Pin
jon-8030-Sep-06 0:30
professionaljon-8030-Sep-06 0:30 
AnswerRe: private variable not retaining its value Pin
Guffa30-Sep-06 6:56
Guffa30-Sep-06 6:56 
GeneralRe: private variable not retaining its value Pin
jon-8030-Sep-06 8:42
professionaljon-8030-Sep-06 8:42 
Questionnetwork Pin
fatidarya29-Sep-06 19:54
fatidarya29-Sep-06 19:54 
AnswerRe: network Pin
Dave Kreskowiak1-Oct-06 14:44
mveDave Kreskowiak1-Oct-06 14:44 
GeneralRe: network Pin
fatidarya1-Oct-06 20:29
fatidarya1-Oct-06 20:29 
GeneralRe: network Pin
Dave Kreskowiak2-Oct-06 3:12
mveDave Kreskowiak2-Oct-06 3:12 
QuestionData Source name not defined and default driver specified Pin
bony_baba29-Sep-06 18:51
bony_baba29-Sep-06 18:51 
AnswerRe: Data Source name not defined and default driver specified Pin
Dave Kreskowiak1-Oct-06 14:46
mveDave Kreskowiak1-Oct-06 14:46 
QuestionHow to deploy a project? Pin
cstrader23229-Sep-06 17:37
cstrader23229-Sep-06 17:37 
AnswerRe: How to deploy a project? Pin
Dave Kreskowiak1-Oct-06 14:51
mveDave Kreskowiak1-Oct-06 14:51 
QuestionUnable to shut down windows with VB.Net App loaded. Pin
Dick Bellnier29-Sep-06 14:52
Dick Bellnier29-Sep-06 14:52 
AnswerRe: Unable to shut down windows with VB.Net App loaded. Pin
Dave Kreskowiak1-Oct-06 14:55
mveDave Kreskowiak1-Oct-06 14:55 
QuestionReading and renaming Excel Files Help Needed Pin
CraigBob29-Sep-06 13:36
CraigBob29-Sep-06 13:36 
Questionhow to reflect changes Pin
praveen kumar mahto29-Sep-06 3:09
praveen kumar mahto29-Sep-06 3:09 
AnswerRe: how to reflect changes Pin
Guffa29-Sep-06 3:27
Guffa29-Sep-06 3:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.