|
Have you tried to do this yourself? People here will be willing to help you if you get stuck with specific problems, but no one is going to do your work for you.
The problem seems to be pretty well stated and should provide you with enough information to list the requirements. Once you list out the requirements, think about what you need to do in order to accomplish each requirement.
I will give you a few pointers...you will need some sort of database in order to keep track of who has previously attended a conference and the actual conference registrations. You will also need the front-end application. Even though the problem specifically says it must be a mobile device, don't let that limit how you would design the solution from a "big picture" standpoint. The high-level requirements will be the same no matter what, and the underlying architecture will be pretty much the same as well. The biggest impact it will have will be on the choice of user interface controls and layout.
|
|
|
|
|
well the thing is, i really have no idea how to do this. I don't even no were to start. I just started and our professor got pissed and assigned this to our class because of everyone having trouble, i no she said not to use a database and to just "think about it and you'll get it"
but thanks anyway,
Jesse
P.S. What should be the first thing i try?
/J-Man\
|
|
|
|
|
using ErrorProvider in VB HELP!!
My problem is the errorProvider show but it doesn't stay visible? it is just visible for a split of second after the MSGBOX has been click OK then after that? it seems it automatically dispose or hide itself that it wasn't mean to be???
I don't know why?? Please anyone with a kind heart to help me with this difficulties of mine?? please be patience about my bit of ignorance with this control i've just used this control for the first time.. ehehe.. ERRORPROVIDER in VB...
**************
Sub OnErrorMessage(ByVal controlOnError As Control, _
ByVal errorMessage As String)
ErrorProvider.SetError(controlOnError, errorMessage)
MsgBox(errorMessage, MsgBoxStyle.Exclamation)
controlOnError.Focus()
End Sub
Function DataFieldValidation() As Boolean
Dim valid As Boolean = True
Try
If String.IsNullOrEmpty(txtboxLastname.Text) Then
OnErrorMessage(txtboxLastname, _
"LastName TextField is required and could not be empty..")
valid = False
Exit Try
End If
Catch ex As Exception
MsgBox(ex.ToString())
End Try
Return valid
End Function
Friend Sub UpdateRecord()
Try
Me.Cursor = Cursors.WaitCursor
If DataFieldValidation() = False Then
Me.Cursor = Cursors.Default
Exit Sub
End If
' i've ommitted other database transaction codes here
' to minimize this post
Me.Cursor = Cursors.Default
Catch ex As Exception
MsgBox(ex.ToString())
End Try
End sub
**************
advance thank you so much to any reply.. please...
-- modified at 22:21 Friday 19th October, 2007
|
|
|
|
|
Hey all, I'm having trouble creating a program that lets two players play a game of tic tac toe. I'm not sure exactly how to let my winSub figure out which boxes make up the winning combination (of three of the same characters in a row)
Here's part of my code:
Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click
'checks if winner exists
Dim strBox1, strBox2, strBox3 As String
If txtTL.Text = txtTM.Text And txtTM.Text = txtTR.Text And txtTL.Text <> "" Then
strBox1 = txtTL.Text
strBox2 = txtTM.Text
strBox3 = txtTR.Text
Call subWin(strBox1, strBox2, strBox3, txtTL.Text)
ElseIf txtTR.Text = txtMM.Text And txtMM.Text = txtBL.Text And txtTL.Text <> "" Then
strBox1 = txtTR.Text
strBox2 = txtMM.Text
strBox3 = txtBL.Text
Call subWin(strBox1, strBox2, strBox3, txtTR.Text)
End If
End Sub
Private Sub subWin(ByVal strBoxOne As String, ByVal strBoxTwo As String, ByVal strBoxThree As String, ByVal strWinner As String)
'this will be called when the program sees a winner
lblResult.Text = ("The winner is " & strWinner)
Select Case strBoxOne
Case "TL"
txtTL.BackColor = Color.Blue
Case "TM"
txtTM.BackColor = Color.Blue
Case "TR"
txtTR.BackColor = Color.Blue
Case "ML"
txtML.BackColor = Color.Blue
Case "MM"
txtMM.BackColor = Color.Blue
Case "MR"
txtMR.BackColor = Color.Blue
Case "BL"
txtBL.BackColor = Color.Blue
Case "BM"
txtBM.BackColor = Color.Blue
Case "BR"
txtBR.BackColor = Color.Blue
End Select
Any help would be greatly appreciated.
|
|
|
|
|
Hi,
without arrays, you will need a lot of code since there are 8 positions where you
can have a win (3 rows, 3 cols, 2 diags).
I would suggest a single, linear, array layed out like this:
0 1 2
3 4 5
6 7 8
containing say integers (0=empty, 1=player 1, 2=player 2)
Note: or characters (' '=empty, 'X'=player 1, 'O'=player 2)
Then recognizing a win after player N moved(=1 or 2, or 'X'/'O'), is looking
for three values N at three array positions with
start index = 0 3 6 0 1 2 0 2
index incr = 1 1 1 3 3 3 4 2
which themselves can also be kept in two arrays,
hence a simple for loop over these 8 possibilities would do it.
Note that I separate the GUI parts (textboxes, whatever) from the game logic!
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi this is the complite project so just copy and past in to ur project
good luck
take care
*********************************************
Option Explicit On
Option Strict On
Public Class frmTicTacToe
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents picMark1 As System.Windows.Forms.PictureBox
Friend WithEvents picMark2 As System.Windows.Forms.PictureBox
Friend WithEvents picTurn As System.Windows.Forms.PictureBox
Friend WithEvents picMark3 As System.Windows.Forms.PictureBox
Friend WithEvents picMark4 As System.Windows.Forms.PictureBox
Friend WithEvents picMark5 As System.Windows.Forms.PictureBox
Friend WithEvents picMark6 As System.Windows.Forms.PictureBox
Friend WithEvents picMark7 As System.Windows.Forms.PictureBox
Friend WithEvents picMark8 As System.Windows.Forms.PictureBox
Friend WithEvents picMark9 As System.Windows.Forms.PictureBox
Friend WithEvents picEarth As System.Windows.Forms.PictureBox
Friend WithEvents picSun As System.Windows.Forms.PictureBox
Friend WithEvents btnReset As System.Windows.Forms.Button
Friend WithEvents lblTurn As System.Windows.Forms.Label
Friend WithEvents btnExit As System.Windows.Forms.Button
Friend WithEvents picTie As System.Windows.Forms.PictureBox
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents mnuFile As System.Windows.Forms.MenuItem
Friend WithEvents mnuFileNew As System.Windows.Forms.MenuItem
Friend WithEvents mnuFileTotal As System.Windows.Forms.MenuItem
Friend WithEvents mnuFileBar As System.Windows.Forms.MenuItem
Friend WithEvents mnuFileExit As System.Windows.Forms.MenuItem
Friend WithEvents mnuHelp As System.Windows.Forms.MenuItem
Friend WithEvents mnuHelpAbout As System.Windows.Forms.MenuItem
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmTicTacToe))
Me.lblTurn = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.picMark1 = New System.Windows.Forms.PictureBox
Me.picMark2 = New System.Windows.Forms.PictureBox
Me.picMark3 = New System.Windows.Forms.PictureBox
Me.picMark4 = New System.Windows.Forms.PictureBox
Me.picMark5 = New System.Windows.Forms.PictureBox
Me.picMark6 = New System.Windows.Forms.PictureBox
Me.picMark7 = New System.Windows.Forms.PictureBox
Me.picMark8 = New System.Windows.Forms.PictureBox
Me.picMark9 = New System.Windows.Forms.PictureBox
Me.btnReset = New System.Windows.Forms.Button
Me.picEarth = New System.Windows.Forms.PictureBox
Me.picSun = New System.Windows.Forms.PictureBox
Me.picTurn = New System.Windows.Forms.PictureBox
Me.btnExit = New System.Windows.Forms.Button
Me.picTie = New System.Windows.Forms.PictureBox
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.mnuFile = New System.Windows.Forms.MenuItem
Me.mnuFileNew = New System.Windows.Forms.MenuItem
Me.mnuFileTotal = New System.Windows.Forms.MenuItem
Me.mnuFileBar = New System.Windows.Forms.MenuItem
Me.mnuFileExit = New System.Windows.Forms.MenuItem
Me.mnuHelp = New System.Windows.Forms.MenuItem
Me.mnuHelpAbout = New System.Windows.Forms.MenuItem
Me.SuspendLayout()
'
'lblTurn
'
Me.lblTurn.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblTurn.Location = New System.Drawing.Point(200, 16)
Me.lblTurn.Name = "lblTurn"
Me.lblTurn.Size = New System.Drawing.Size(104, 32)
Me.lblTurn.TabIndex = 0
Me.lblTurn.Text = "Turn"
Me.lblTurn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label2
'
Me.Label2.BackColor = System.Drawing.Color.Blue
Me.Label2.Location = New System.Drawing.Point(160, 80)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(8, 440)
Me.Label2.TabIndex = 1
'
'Label3
'
Me.Label3.BackColor = System.Drawing.Color.Blue
Me.Label3.Location = New System.Drawing.Point(336, 80)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(8, 440)
Me.Label3.TabIndex = 2
'
'Label4
'
Me.Label4.BackColor = System.Drawing.Color.Blue
Me.Label4.Location = New System.Drawing.Point(8, 216)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(496, 8)
Me.Label4.TabIndex = 3
'
'Label5
'
Me.Label5.BackColor = System.Drawing.Color.Blue
Me.Label5.Location = New System.Drawing.Point(8, 376)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(496, 8)
Me.Label5.TabIndex = 4
'
'picMark1
'
Me.picMark1.Location = New System.Drawing.Point(40, 96)
Me.picMark1.Name = "picMark1"
Me.picMark1.Size = New System.Drawing.Size(90, 90)
Me.picMark1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark1.TabIndex = 5
Me.picMark1.TabStop = False
'
'picMark2
'
Me.picMark2.Location = New System.Drawing.Point(208, 96)
Me.picMark2.Name = "picMark2"
Me.picMark2.Size = New System.Drawing.Size(90, 90)
Me.picMark2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark2.TabIndex = 6
Me.picMark2.TabStop = False
'
'picMark3
'
Me.picMark3.Location = New System.Drawing.Point(384, 96)
Me.picMark3.Name = "picMark3"
Me.picMark3.Size = New System.Drawing.Size(90, 90)
Me.picMark3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark3.TabIndex = 7
Me.picMark3.TabStop = False
'
'picMark4
'
Me.picMark4.Location = New System.Drawing.Point(40, 256)
Me.picMark4.Name = "picMark4"
Me.picMark4.Size = New System.Drawing.Size(90, 90)
Me.picMark4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark4.TabIndex = 8
Me.picMark4.TabStop = False
'
'picMark5
'
Me.picMark5.Location = New System.Drawing.Point(208, 256)
Me.picMark5.Name = "picMark5"
Me.picMark5.Size = New System.Drawing.Size(90, 90)
Me.picMark5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark5.TabIndex = 9
Me.picMark5.TabStop = False
'
'picMark6
'
Me.picMark6.Location = New System.Drawing.Point(384, 256)
Me.picMark6.Name = "picMark6"
Me.picMark6.Size = New System.Drawing.Size(90, 90)
Me.picMark6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark6.TabIndex = 10
Me.picMark6.TabStop = False
'
'picMark7
'
Me.picMark7.Location = New System.Drawing.Point(40, 408)
Me.picMark7.Name = "picMark7"
Me.picMark7.Size = New System.Drawing.Size(90, 90)
Me.picMark7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark7.TabIndex = 11
Me.picMark7.TabStop = False
'
'picMark8
'
Me.picMark8.Location = New System.Drawing.Point(208, 408)
Me.picMark8.Name = "picMark8"
Me.picMark8.Size = New System.Drawing.Size(90, 90)
Me.picMark8.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark8.TabIndex = 12
Me.picMark8.TabStop = False
'
'picMark9
'
Me.picMark9.Location = New System.Drawing.Point(384, 408)
Me.picMark9.Name = "picMark9"
Me.picMark9.Size = New System.Drawing.Size(90, 90)
Me.picMark9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picMark9.TabIndex = 13
Me.picMark9.TabStop = False
'
'btnReset
'
Me.btnReset.Location = New System.Drawing.Point(200, 560)
Me.btnReset.Name = "btnReset"
Me.btnReset.Size = New System.Drawing.Size(104, 23)
Me.btnReset.TabIndex = 14
Me.btnReset.Text = "&Reset Game"
'
'picEarth
'
Me.picEarth.Image = CType(resources.GetObject("picEarth.Image"), System.Drawing.Image)
Me.picEarth.Location = New System.Drawing.Point(56, 536)
Me.picEarth.Name = "picEarth"
Me.picEarth.Size = New System.Drawing.Size(60, 60)
Me.picEarth.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picEarth.TabIndex = 15
Me.picEarth.TabStop = False
Me.picEarth.Visible = False
'
'picSun
'
Me.picSun.BackColor = System.Drawing.Color.Silver
Me.picSun.Image = CType(resources.GetObject("picSun.Image"), System.Drawing.Image)
Me.picSun.Location = New System.Drawing.Point(400, 536)
Me.picSun.Name = "picSun"
Me.picSun.Size = New System.Drawing.Size(60, 56)
Me.picSun.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picSun.TabIndex = 16
Me.picSun.TabStop = False
Me.picSun.Visible = False
'
'picTurn
'
Me.picTurn.Location = New System.Drawing.Point(136, 8)
Me.picTurn.Name = "picTurn"
Me.picTurn.Size = New System.Drawing.Size(50, 50)
Me.picTurn.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picTurn.TabIndex = 17
Me.picTurn.TabStop = False
'
'btnExit
'
Me.btnExit.Location = New System.Drawing.Point(392, 24)
Me.btnExit.Name = "btnExit"
Me.btnExit.TabIndex = 18
Me.btnExit.Text = "&Exit Game"
'
'picTie
'
Me.picTie.Image = CType(resources.GetObject("picTie.Image"), System.Drawing.Image)
Me.picTie.Location = New System.Drawing.Point(8, 8)
Me.picTie.Name = "picTie"
Me.picTie.Size = New System.Drawing.Size(50, 50)
Me.picTie.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picTie.TabIndex = 19
Me.picTie.TabStop = False
Me.picTie.Visible = False
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuFile, Me.mnuHelp})
'
'mnuFile
'
Me.mnuFile.Index = 0
Me.mnuFile.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuFileNew, Me.mnuFileTotal, Me.mnuFileBar, Me.mnuFileExit})
Me.mnuFile.Text = "&File"
'
'mnuFileNew
'
Me.mnuFileNew.Index = 0
Me.mnuFileNew.Shortcut = System.Windows.Forms.Shortcut.CtrlN
Me.mnuFileNew.Text = "&New Game"
'
'mnuFileTotal
'
Me.mnuFileTotal.Index = 1
Me.mnuFileTotal.Shortcut = System.Windows.Forms.Shortcut.CtrlT
Me.mnuFileTotal.Text = "&Total game"
'
'mnuFileBar
'
Me.mnuFileBar.Index = 2
Me.mnuFileBar.Text = "-"
'
'mnuFileExit
'
Me.mnuFileExit.Index = 3
Me.mnuFileExit.Shortcut = System.Windows.Forms.Shortcut.CtrlE
Me.mnuFileExit.Text = "E&xit Game"
'
'mnuHelp
'
Me.mnuHelp.Index = 1
Me.mnuHelp.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuHelpAbout})
Me.mnuHelp.Text = "&Help"
'
'mnuHelpAbout
'
Me.mnuHelpAbout.Index = 0
Me.mnuHelpAbout.Text = "&About Tic-Tac-Toe"
'
'frmTicTacToe
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(520, 613)
Me.Controls.Add(Me.picTie)
Me.Controls.Add(Me.btnExit)
Me.Controls.Add(Me.picTurn)
Me.Controls.Add(Me.picSun)
Me.Controls.Add(Me.picEarth)
Me.Controls.Add(Me.btnReset)
Me.Controls.Add(Me.picMark9)
Me.Controls.Add(Me.picMark8)
Me.Controls.Add(Me.picMark7)
Me.Controls.Add(Me.picMark6)
Me.Controls.Add(Me.picMark5)
Me.Controls.Add(Me.picMark4)
Me.Controls.Add(Me.picMark3)
Me.Controls.Add(Me.picMark2)
Me.Controls.Add(Me.picMark1)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.lblTurn)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Menu = Me.MainMenu1
Me.Name = "frmTicTacToe"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Tic - Tac - Toe Problem"
Me.ResumeLayout(False)
End Sub
#End Region
Dim EarthTurn As Boolean 'if True, it's Earth's turn
Dim CanClick As Boolean 'if Turn, can click grid
Dim NumberClicks As Integer 'Number of grid clicks
Dim Marker(9) As Integer 'what marker is in what location(1-Earth,2-Sun)
Private Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
Dim I As Integer
picMark1.Image = Nothing
picMark2.Image = Nothing
picMark3.Image = Nothing
picMark4.Image = Nothing
picMark5.Image = Nothing
picMark6.Image = Nothing
picMark7.Image = Nothing
picMark8.Image = Nothing
picMark9.Image = Nothing
For I = 1 To 9
Marker(I) = 0
Next I
'make it earth's turn
picTurn.Image = picEarth.Image
lblTurn.Text = "Tutn"
EarthTurn = True
CanClick = True
NumberClicks = 0
End Sub
Private Sub frmTicTacToe_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
btnReset.PerformClick()
End Sub
Private Sub picMark_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles picMark1.Click, _
picMark2.Click, picMark3.Click, picMark4.Click, picMark5.Click, picMark6.Click, picMark7.Click, _
picMark8.Click, picMark9.Click
'Decide which picture was clicked(1-9)
Dim picClicked As PictureBox, Index As Integer
Dim Win As Boolean
picClicked = CType(sender, PictureBox)
'Index is last digit of control name
Index = CInt(Val(Mid(picClicked.Name, Len(picClicked.Name), 1)))
'if can't click or mark already there exit sub
If Not (CanClick) Or Marker(Index) <> 0 Then
Exit Sub
End If
'increment click then mark
NumberClicks = NumberClicks + 1
If EarthTurn Then
Marker(Index) = 1
picClicked.Image = picEarth.Image
Else : Marker(Index) = 2
picClicked.Image = picSun.Image
End If
Win = False
'check for win
If Marker(1) = Marker(Index) And Marker(2) = Marker(Index) And Marker(3) = Marker(Index) Then
'top horizontal win
Win = True
ElseIf Marker(4) = Marker(Index) And Marker(5) = Marker(Index) And Marker(6) = Marker(Index) Then
'middle horizontal win
Win = True
ElseIf Marker(7) = Marker(Index) And Marker(8) = Marker(Index) And Marker(9) = Marker(Index) Then
'botton horizontal win
Win = True
ElseIf Marker(1) = Marker(Index) And Marker(4) = Marker(Index) And Marker(7) = Marker(Index) Then
'left vertical win
Win = True
ElseIf Marker(2) = Marker(Index) And Marker(5) = Marker(Index) And Marker(8) = Marker(Index) Then
'middle vertical win
Win = True
ElseIf Marker(3) = Marker(Index) And Marker(6) = Marker(Index) And Marker(9) = Marker(Index) Then
'right vertical win
Win = True
ElseIf Marker(1) = Marker(Index) And Marker(5) = Marker(Index) And Marker(9) = Marker(Index) Then
'top,left down diagonal win
Win = True
ElseIf Marker(7) = Marker(Index) And Marker(5) = Marker(Index) And Marker(3) = Marker(Index) Then
'bottom, left up diagonal win
Win = True
End If
If Win Then
' there's a win
lblTurn.Text = "Win!!!"
CanClick = False
Else
'if we got this far, this was no win
If NumberClicks < 9 Then
EarthTurn = Not (EarthTurn)
If EarthTurn Then
picTurn.Image = picEarth.Image
Else
picTurn.Image = picSun.Image
End If
Else
'If there's nine clicks and no win, it's a tie
picTurn.Image = picTie.Image
lblTurn.Text = "A Tie ...."
CanClick = False
End If
End If
End Sub
Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
Dim response As DialogResult
response = MessageBox.Show("Are you sure you want to exit ?", "Exit Game", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If response = DialogResult.Yes Then
Me.Close()
Else : Exit Sub
End If
End Sub
Private Sub mnuFileNew_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuFileNew.Click
Dim I As Integer
Dim Message As String
Dim Response As DialogResult
Response = MessageBox.Show("Are you sure you want to start new game ?", "Exit Game", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Response = DialogResult.Yes Then
picMark1.Image = Nothing
picMark2.Image = Nothing
picMark3.Image = Nothing
picMark4.Image = Nothing
picMark5.Image = Nothing
picMark6.Image = Nothing
picMark7.Image = Nothing
picMark8.Image = Nothing
picMark9.Image = Nothing
For I = 1 To 9
Marker(I) = 0
Next I
Else
Exit Sub
End If
'make it earth's turn
picTurn.Image = picEarth.Image
lblTurn.Text = "Tutn"
EarthTurn = True
CanClick = True
NumberClicks = 0
End Sub
Private Sub mnuHelpAbout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuHelpAbout.Click
Dim Myform As New frmAbout
Myform.Show()
End Sub
Private Sub mnuFileTotal_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuFileTotal.Click
Static TGame As Integer = 1
Dim Win As Boolean
Dim Message As String
If Win = True Or Win = False Then
TGame += 1
End If
Message = "Total Game : - " + Str(TGame) + ControlChars.Cr
MessageBox.Show(Message, "Statistics", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Class
|
|
|
|
|
Since Visual Studio can create different project of Visual Studio VB or Visual Studio C++, can we convert a project Visual Studio VB to project Visual Studio C++? If so how can I do it?
Certain methods will not be converted 100%, but it will be corrected faster than create a new C++ from the scratch!
Thank to any help!
|
|
|
|
|
Google "VB to C++ converter" (you'll see us there and find other useful links).
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to C++/CLI Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
Do you want to convert your code of VB to VC++?
|
|
|
|
|
Hello,
I have got a little test application, which provides an WCF service and wants to consume it as well. The access does only succeed for the case, that the consumption is done by another application instance, but that's not really the thing I want. My question now is, if my problem is gernerally solveable, and if so, in which way I have to change my code.
Thank you for your help!
Robert
ITestService.vb
<br />
<ServiceModel.ServiceContract()> _<br />
Public Interface ITestService<br />
<br />
<ServiceModel.OperationContract()> Function HelloWorld() As String<br />
<br />
End Interface<br />
TestService.vb
<br />
<ServiceModel.ServiceBehavior()> _<br />
Public Class TestService<br />
Implements ITestService<br />
<br />
Public Function HelloWorld() As String Implements ITestService.HelloWorld<br />
Return "Hello World!"<br />
End Function<br />
<br />
End Class<br />
FrmMain.vb
<br />
Public Class FrmMain<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
' Provide the service!<br />
Dim host As New ServiceModel.ServiceHost(GetType(TestService))<br />
host.Open()<br />
MsgBox("Service started.")<br />
End Sub<br />
<br />
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
' Connect to the service!<br />
Dim address As New ServiceModel.EndpointAddress("net.pipe://localhost/TestHost")<br />
Dim binding As New ServiceModel.NetNamedPipeBinding()<br />
<br />
Dim service As ITestService = ServiceModel.ChannelFactory(Of ITestService).CreateChannel(binding, address)<br />
MessageBox.Show(service.HelloWorld())<br />
End Sub<br />
<br />
End Class<br />
|
|
|
|
|
app.config
You can find the configuration file at this location. It was not possible to display it here in a suitable style.
|
|
|
|
|
hello sir,
i am new in .net. i had made a window application in vb.net
as front end and sql-sever as back end.
now the problem is that how to install sql-server ,.netframework,and execute sql-script and my project on client computer step by step. plz give me details .
|
|
|
|
|
You would need to script an installer application to install those for you (i am guessing thats what you want to do)
Try out
http://www.microsoft.com/downloads/details.aspx?FamilyId=5FBC5470-B259-4733-A914-A956122E08E8&displaylang=en&displaylang=en
or
http://nsis.sourceforge.net/Main_Page
|
|
|
|
|
Please don't cross post. You posted this same message in the .NET Framework[^] forum, and the C#[^] forum as well as here, all within about 10 minutes of each other.
The people that answer questions on these forums do so on a volunteer basis and may not respond to your post as quickly as you might prefer. Posting the same question multiple times is only a way to help ensure that you don't get an answer.
|
|
|
|
|
|
Hi All;
I'm writing a small app that is displaying information in a datagridview from a FoxPro table. I am having issues on the update side of things. I am trying to write my own update statements using the ODBCCommand object, and parameters. However, the statement is failing, with only the message of Syntax Error. When I try to get the actual command text, it shows the sql statement with the @VarName placeholders. Is there anyway to get the final sql statement? Or should it show as the command text, and I am setting this up wrong. Here is what I am doing:
<br />
sql = "UPDATE table1 SET Descript = @Desc "<br />
sql += "WHERE RefNum = @RefNum "<br />
<br />
cmd.CommandText = sql<br />
<br />
parm = New OdbcParameter("@desc", SqlDbType.Char, 120)<br />
parm.Value = oRow.Item("description").ToString().Trim() <br />
cmd.Parameters.Add(parm)<br />
<br />
parm = New OdbcParameter("@refnum", SqlDbType.Char, 12)<br />
parm.Value = oRow.Item("ref num").ToString().Trim()<br />
cmd.Parameters.Add(parm)<br />
<br />
cmd.ExecuteNonQuery() 'This fails with Syntax Error<br />
This is a shortened version, there are around 15 variables I am using. When I check the value of CommandText, it shows as: "UPDATE table1 sET Descript = @Desc WHERE RefNum = @RefNum"
I am guessing this is what it should show, but is there anyway to see what is actually being sent to execute?
Thanks
|
|
|
|
|
Whenever I've used parameters, I've always had to do a cmd.DeriveParameters before I could set the parameters value...I'm not sure if it is a required call but you may want to look into it.
Also, I do not believe there is a way during debugging to see what the actual statement being sent is. You could try putting in a try-catch block and quickwatching the exception, it may have more detailed error messages.
Hope this helps.
|
|
|
|
|
I dont think that cmd.DeriveParameters is a valid statement in vb.net, at least not for an OdbcCommand. I thought about the try-catch, just reports the same error, "Syntax Error". I really hate FoxPro...
And now, adding color, a group of anonymous Latin American meat packing glitterati
|
|
|
|
|
go through the item list and and concat all the values using a delimiter like a pipe or something
|
|
|
|
|
When printing a report from the reportviewer to the Zebra TLP2844 it does not print the report in landscape. When printing to the HP laser printer landscape works fine. Is there something I need to do to get the Zebra to print in landscape?
When printing a word doc to the Zebra printer it does print in landscape.
I do have the lastest version of the reportviewer.
|
|
|
|
|
I need to get the folder list of an ftp site
I found some code that (after adapting a small bit) does exactly that but if I try to request the folder list for a specific folder it doesn't work anymore.
Order of events: I check to see if the folder 'ftpmap' is present in the root directory of the ftpserver
if not: I create it
---untill here everything works perfectly
I check to see if the folder 'test' is present in the folder 'ftpmap'
---this is where things go wrong
I get an error:
The remote server returned an error: (450) File unavailable (e.g., file busy).
from what I'v been able to figure out is that the folder 'ftpmap' is still in use by the previous request. But I closed everything I could think off.
here is the code that requests the folders (and files) of a ftpserver:
Public Function GetFolderList(ByVal ftppath As String) As List(Of String)
Dim folderlist As New List(Of String)
'Try
Dim result As New System.Text.StringBuilder()
Dim reqFTP As FtpWebRequest
reqFTP = DirectCast(FtpWebRequest.Create(New Uri(ftppath & "/")), FtpWebRequest)
reqFTP.UseBinary = True
reqFTP.KeepAlive = False
reqFTP.Credentials = New NetworkCredential(ftpuser, ftppass)
reqFTP.Method = WebRequestMethods.Ftp.ListDirectory
Dim response As WebResponse = reqFTP.GetResponse() ' THIS IS WHERE THE ERROR HAPPENS
Dim reader As New StreamReader(response.GetResponseStream())
'MessageBox.Show(reader.ReadToEnd());
Dim line As String = reader.ReadLine()
While line IsNot Nothing
result.Append(line)
result.Append("" & Chr(10) & "")
line = reader.ReadLine()
End While
result.Remove(result.ToString().LastIndexOf(Chr(10)), 1)
Dim sall As String() = result.ToString.Split(Chr(10))
For Each s As String In sall
If Not s.Contains(".") Then
folderlist.Add(s)
End If
Next
reader.Close()
response.Close()
Return folderlist 'result.ToString().Split(Chr(10))
'Catch ex As Exception
'End Try
Return folderlist
End Function
does anyone know why this is happening or does anyone have a better way of doing this.
-- modified at 10:11 Friday 19th October, 2007
is there anyway I can extract the number (450) from the execption?? besides the contains methode
because if I can do that I can have my programme working perfectly
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
How can I set my program to only download if a newer version is available? My program right now is set to download a file from my site every time it opens but I dont want it to do that. I would like to only download the file if the time and data has changed in the FTP?
|
|
|
|
|
|
hi friend
i have edting the value of app.config in windows application. code work properly its not give any error but its not change the value of app.config
plese help code:-
Public Sub asaas()
Dim XmlDoc As New XmlDocument()
'XmlDoc.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
Try
XmlDoc.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
' Navigate Each xml Element of app.Config file
Dim NodeList As System.Xml.XmlNode = XmlDoc.SelectSingleNode("/configuration/applicationSettings/filesave.My.MySettings/setting/value")
' Save app.config file
NodeList.InnerXml = TextBox1.Text
XmlDoc.Save(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
app.config:-
(?xml version="1.0" encoding="utf-8" ?)
(configuration)
(applicationSettings)
(filesave.My.MySettings)
(setting name="filesave_localhost5_Service" serializeAs="String")
(value)http://localhost/file/Service.asmx(/value)
(/setting)
(/filesave.My.MySettings)
(/applicationSettings)
(/configuration)
plese help argent
Piyush Vardhan Singh
|
|
|
|
|
hi All
Am Trying to sending an E-mail from my Windows Vb Application, i want to know the namespace that am going to import. am using vs2003. please provide me with an Example code, tutorial or an Article for sending an E-mail in a wndows application.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|