some help needed with buttons

buttons not working correctly

Page 1 of 1

2 Replies - 487 Views - Last Post: 23 June 2009 - 08:49 AM Rate Topic: -----

#1 prabh  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 3
  • View blog
  • Posts: 381
  • Joined: 27-December 08

some help needed with buttons

Posted 21 June 2009 - 08:02 PM

Hi
I was creating GTA SA save editer in c++
but due to less features in c++ I converted my whole code vb.net

 Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click
        Dim instr As New FileStream(Label2.Text, FileMode.Open)
        Dim binin As New BinaryReader(instr)
        Dim buffcheck(202748) As Byte
        buffcheck = binin.ReadBytes(202748)
        binin.Close()
        instr.Close()
        Dim moneywri As New FileStream(Label2.Text, FileMode.Open)
        Dim binmoney As New BinaryWriter(moneywri)
        Dim moneey As UInt32 = Val(MoneyTextBox.Text)
        binmoney.Seek(blockoffset(14) + 9, SeekOrigin.Current)
        binmoney.Write(moneey)
        binmoney.Seek(blockoffset(14) + 21, SeekOrigin.Begin)
        binmoney.Write(moneey)
        moneywri.Close()
        binmoney.Close()
        Dim ostream As New FileStream(Label2.Text, FileMode.Open)
        Dim binout As New BinaryWriter(ostream)
        Dim sum As UInt32 = 0
        For i = 0 To 202747'checksum loop starts here
            sum = sum + buffcheck(i)
        Next
        Me.Text = sum.ToString("X2")
        binout.Seek(202748, SeekOrigin.Current)
        binout.Write(sum)
        binout.Close()
        ostream.Close()





my problem is when i click the button then it saves the money changes in the file
but doesn't saves the checksum but when I double click it saves the both things



So how do i stop this I want it in one click

Is This A Good Question/Topic? 0
  • +

Replies To: some help needed with buttons

#2 vbnet9  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 356
  • Joined: 26-May 09

Re: some help needed with buttons

Posted 21 June 2009 - 09:09 PM

I find that sometimes check boxes don't work for me, so what I do is copy all my code within the check box function, then I delete the function sub and the check box in the form designer. After that I remake the check box then paste the code back to the function.

This usually works for me when a toolbox item doesn't work for me.
Was This Post Helpful? 0
  • +
  • -

#3 prabh  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 3
  • View blog
  • Posts: 381
  • Joined: 27-December 08

Re: some help needed with buttons

Posted 23 June 2009 - 08:49 AM

Hey
Thats not working for me and it is a button

can someone else help me
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1