Jump to content
Xtreme .Net Talk

LamKat

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by LamKat

  1. 1) .Close is a good idea as without it the file is still open in the RAM. It is good practice. 2) i can't see a quicker way of doing it, unless you want to change your 'Explicit' option to off. so don't change a thing in this case, as it is a small enough peace of coding anyway > LamKat
  2. Do you mean combo boxes or list boxes. if you do mean combo boxes then do something like If ComboBox1.Text = ComboBox2.text Then combobox2.text = "four" if that is not helpful then can you please expand on your problem and what you need it to do (why should it do what you want it to do)
  3. hey. i'm making a very basic contacts type program, and one of the fetures is that when the user closes the form it checks is any information has not been saved. but for some reason once i placed this sub in it now doesn't close at all Private Sub FormClosing() Handles Me.FormClosing Dim IsDiffrent As Boolean = True For Counter As Byte = 0 To COM_Name.Items.Count - 1 If COM_Name.Text = COM_Name.Items.Item(Counter) Then Dim Information(0 To 7) As String Dim TxtReader As New StreamReader(My.Application.Info.DirectoryPath & "\" & COM_Name.Text & ".txt") For InfoCounter As Byte = 0 To 7 Information(InfoCounter) = TxtReader.ReadLine Next TxtReader.Close() If Information(0) = TXT_HomePhone.Text And _ Information(1) = TXT_MobPhone.Text And _ Information(2) = DTP_Birthday.Value And _ Information(3) = TXT_HomeAddress.Lines(1) And _ Information(4) = TXT_HomeAddress.Lines(2) And _ Information(5) = TXT_HomeAddress.Lines(3) And _ Information(6) = TXT_HomeAddress.Lines(4) And _ Information(7) = TXT_Email.Text Then IsDiffrent = False End If End If Next If IsDiffrent = True Then Dim Answer As Byte = MsgBox("Do you wish to Save Changes?", MsgBoxStyle.YesNo) If Answer = 6 Then Call Save(True, "Closing") End If Else Me.Close() End If End Sub (please note that it is not even getting to the save changes msgbox)
  4. yh. i kinda understand what you are saying but can you think of any way to code it so that this problem is avoided without losing the changeability of the current non functioning code?
  5. hi all. I've been trying to make a basic version of mine sweeper. when i ran the program it did not give me all the expected outputs. i have tracked back the error to this bit of code that i have eddited down to just the bits that dont run and the context in which the code makes sence... can anyone see the problem Dim Xlength As Integer = 5 - 1, _ YLength As Integer = 5 - 1, _ chosen(0 To Xlength, 0 To YLength) As Boolean, _ value(0 To Xlength, 0 To YLength) As Integer, _ NoOfMines As Integer Private Sub set_board() Handles Me.Load NoOfMines = (((Xlength + 1) * (YLength + 1)) ^ 0.5) - 1 For FirstD As Integer = 0 To Xlength For SecondD As Integer = 0 To YLength chosen(FirstD, SecondD) = False value(FirstD, SecondD) = 0 Next Next Dim RandomD1, RandomD2 As Integer Randomize() For counter As Integer = 1 To NoOfMines Do RandomD1 = Rnd() * Xlength RandomD2 = Rnd() * YLength Loop Until chosen(RandomD1, RandomD2) = False chosen(RandomD1, RandomD2) = True Next Dim number As Integer For FirstD As Integer = 0 To Xlength For SecondD As Integer = 0 To YLength If chosen(FirstD, SecondD) = False Then number = 0 For X As Integer = -1 To 1 For Y As Integer = -1 To 1 If chosen(FirstD + X, SecondD + Y) = True Then number += 1 Next Y Next X value(FirstD, SecondD) = number Else value(FirstD, SecondD) = -1 End If Next SecondD Next FirstD End Sub i have tryed message boxing parts out and it seems to just stop funning the code at If chosen(FirstD + X, SecondD + Y) = True Then number += 1. MS visual basic 2010 is not giving me any errors, can anyone help me out
  6. PlausiblyDamp, can you think of any, and if so could you post an example of these nested controls for me to use. thanks, LamKat
  7. I've just had a look at the code set in a new form. and i've isolated the problem to the fact that i've been using a tablelayoutpanel with the panels inside the table. at which point it doesn't work... though it also doesn't work for Lineshapes without a table again can anyone think of a solution that doesn't involve not using a tableLayoutPanel
  8. Hey people i've been having problems with vb.net. i like to use 'controls' with looping as to get rid of the need to do basically the same command over and over again. but this comand doesn't work for all objects... and i would like some help so the code goes a little like this For Counter As Integer = 1 To 64 Step +1 Controls("Panel" & Counter).BackColor = Color.Black Next as you could guess this is for a game of chess
  9. hey 'Visualbasic' this is a function inbuilt in VB2010, so it takes like two seconds Please see attached image (if it works obv first of all you need to open the "My Project" int the "Solution Explorer". then you need to make sure that your "Startup Form" is your main form. then you need to change your "Splash screen" to what ever your splash screen is. once this is done all will work fine or if you really want to have the loading bar then you could use this code for your 'form 2' Private Sub [color="Red"]NameOfForm[/color]_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed End End Sub
×
×
  • Create New...