Inheriting Form Issue in VB2005

Hello All,

As usual, I think I'm doing something that's not "Kosher" in trying to inherit a form to a new Item.

I get a ton of errors including data connection, etc. The solution works and builds, publishes and all that, but there seems to be settins somewhere that are pointing the inherit function somewhere else.

Please Help...I don't want to redo all of those controls and buttons again on the new pages.

Thanks,

Elgee...

PS...Any ideas on how to map the numeric keypad to a masked textbox I can't figure out how to advance the digit after a mouse click...I can only get one digit to enter.

Thanks!




Answer this question

Inheriting Form Issue in VB2005

  • warb

    Start a different post thread for Right to Left and I'll answer it there so we address each question in there own post.

    That way it helps others find resolution on issues.


  • Redjo

    Please read the posting suggestions at the top of the forum...

    Thanks!!!!



  • ameoba

    Hi...

    I used the AMOUNT * 20/20 to round...but I need to try to fill in the textbox in reverse, like a cash register does.

    I saw some C# code and converted it...I'm going to try that as a workaround. The rounding works, but its too hard for the keypad to display (to the user) at least.

    Any Ideas Textbox with a righ to left fill

    Elgee

    Have a GREAT Weekend!



  • PhilipT

    The following will do a reformat of the textbox on the lostfocus event. You'll need to ensure that only numbers are entered into the textbox but that has been asked numerous times and a quick search will find those threads.


    Public Class Form1
    Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
    Reformat(TextBox1)
    End Sub

    Sub Reformat(ByRef tb As TextBox)
    Dim StrResult As String
    If tb.Text.Length > 0 Then
    StrResult = Format("#0.00", CInt(tb.Text) / 100)
    tb.Text = StrResult
    End If
    End Sub
    End Class


  • Anachron

    hi,

    Is your problem solved

    Thank you,
    Bhanu.



  • mutzel

    Sure, use something like

    'Dim StrResult As String
    If TextBox1.Text.Length > 0 Then
    Dim s As String
    s = TextBox1.Text.Substring(TextBox1.Text.Length - 1, 1)
    If s = "0" Or s = "5" Then
    StrResult = Format("#0.00", CInt(TextBox1.Text) / 100)
    If StrResult > 45 Then StrResult = 45
    TextBox1.Text = FormatCurrency(StrResult, 2)
    Else
    MsgBox("Need to end in 0 or 5")
    End If
    End If


  • DNet

    Thanks...

    I can't try it until I get home later...

    I will let you know as soon as I can get to another PC.

    Elgee...

    I'll make sure to have only numbers in the box too!



  • PixelSlave

    Welcome to the MSDN boards Elgee!

    See what a difference it made when you were able to clearly state your question It was like day and night for the people supporting you!



  • Leroy Pierce

    Hi, and THANKS!!!!!

    I pasted some of my code, with your code inserted. It works like a charm.

    Can I use the same style to prevent any numbers that don't end with a 0 or 5

    We only work in nickel increments here.

    Thanks again....You're really wonderful!

    Elgee

    Dim StrResult As String
    Dim x As Integer = 0

    Public Sub keyClick( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles key1.Click, Key2.Click, Key3.Click, Key4.Click, Key5.Click, Key6.Click, _
    Key7.Click, Key8.Click, Key9.Click, Key0.Click
    TB3.ForeColor = Color.DarkSeaGreen
    TB1.Text &= sender.tag
    Dim value1
    value1 = TB1.Text
    TB3.Text = value1
    Dim value2
    value2 = x + 1
    cliks.Text = x
    If cliks.Text > 5 Then clearboxes()
    'Dim StrResult As String
    If TB3.Text.Length > 0 Then
    StrResult = Format("#0.00", CInt(TB3.Text) / 100)
    If StrResult > 45 Then StrResult = 45
    TB3.Text = FormatCurrency(StrResult, 2)
    End If
    End Sub
    Private Sub clearboxes()
    x = 0
    TB1.Text = 0.0
    TB3.Text = FormatCurrency(0.0, 2)
    FormatCurrency(TB3.Text, 2)
    cliks.Text = 0.0

    End Sub

    Private Sub Key0_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key0.MouseDown
    x = x + 1
    End Sub

    Private Sub key1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles key1.MouseDown
    x = x + 1
    End Sub

    Private Sub Key2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key2.MouseDown
    x = x + 1
    End Sub

    Private Sub Key3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key3.MouseDown
    x = x + 1
    End Sub

    Private Sub Key4_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key4.MouseDown
    x = x + 1
    End Sub

    Private Sub Key5_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key5.MouseDown
    x = x + 1
    End Sub

    Private Sub Key6_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key6.MouseDown
    x = x + 1
    End Sub

    Private Sub Key7_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key7.MouseDown
    x = x + 1
    End Sub

    Private Sub Key8_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key8.MouseDown
    x = x + 1
    End Sub

    Private Sub Key9_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Key9.MouseDown
    x = x + 1
    End Sub

    Private Sub keyDecimal_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
    x = x + 1
    End Sub

    Private Sub opclearentry_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opclearentry.Click
    clearboxes()
    End Sub



  • robert1352

    Yes Thanks...

    Is there a way to automatically place a decimal point in a text box, as in this example....

    say we enter 125. I need the box to display 1.25. If 1250 is entered, I need 12.50 to be entered.

    I don't want the user to enter a decimal point, nor do I want more than four digits in the display.

    Thanks again,

    Elgee...

    I declared a public variable in the control that gave me access.

    Also, the option explicit was turned on, so I had to redo many of the dim as functions.



  • Inheriting Form Issue in VB2005