Results 1 to 6 of 6

Thread: Problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2007
    Posts
    192

    Problem

    vb.net Code:
    1. Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
    2. If e.KeyChar = Microsoft.VisualBasic.Chr(27) Then
    3.             ComboBox1.Focus()
    4.             Exit Sub
    5.         End If
    6.    
    7.         If e.KeyChar = Microsoft.VisualBasic.Chr(13) Then
    8.             If IsNumeric(TextBox5) Then
    9.            
    10.             End If
    11.             TextBox6.Focus()
    12.         End If
    13.         'End If
    14.         Exit Sub
    15. end sub
    This program shows me error ,all i need is to textbox5 when i write some number into ,and press enter goes to textbox6 and shows me like money(1523 money i spend)- textbox5(i write number like 2000 ,money i gave)=textbox6(cash 473):sorry on my bad english
    Last edited by Hack; Nov 12th, 2007 at 08:15 AM. Reason: Added Highlight Tags

  2. #2
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: Problem

    Hi there!

    Exactly what error do you recieve when you try to run this code?

    /Henrik

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Problem

    You code is syntactically incorrect. I suggest that before we help you - you do some reading.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2007
    Posts
    192

    Re: Problem

    ok i resolved that becuase i already count textbox5 now problem is shows me error .Is this correct wroten?

    Label10 = Format(count - CDbl(Me.Label12.Text), "##,###,##0.#0")
    If tecaj2 <> 0 Then Label11 = Format(CDbl(Label10.Text / tec2), "##,###,##0.#0")

    Value of type 'String' cannot be converted to 'System.Windows.Forms.Label'.

  5. #5
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Re: Problem

    Hi!

    You have to use the property text when assigning a textvalue to a label.

    Like Label11.Text = 'Hello'

    not

    Label11 = 'hello'

    Im pretty sure the label behaves like that... but this can differ depeniding on the class.

    /Henrik

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Problem

    In fact, you should avoid using a control's default property, if for no other reason, than it makes understanding what you are trying to do easier.

    It will also assist in avoiding seemingly unfathomably problems.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width