473,394 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Need Text Box Help

3
I need to store the values of my input text boxes into the variables I have declared (in bold) . My text boxes atr txtInitialValue, txtAssetLife and txtSalvageValue. Can anyone help? Here is my code:



Option Explicit On
Option Strict On

Imports System.Convert

Public Class frmMain
Inherits System.Windows.Forms.Form


Private mlblInitialValue As Double
Private mlblSalvageValue As Double
Private mlblAssetLife As Single



Private Const cintCol1Start As Integer = 100
Private Const cintCol2Start As Integer = 250
Private Const cintCol3Start As Integer = 400
Private Const cintCol4Start As Integer = 550
Private Const cintColWidth As Integer = 150

Private mfntPrint As Font
Private msngFontHeight As Single
Private msngYPos As Single
Private mfnrPrint As Font
Sep 20 '07 #1
3 938
QVeen72
1,445 Expert 1GB
I need to store the values ...
Hi,

Write the code in LostFocus of all the TextBox :
ex:
Expand|Select|Wrap|Line Numbers
  1. mlblInitialValue =Val(txtAssetLife.Text)
  2.  
Regards
Veena
Sep 20 '07 #2
tamik0
3
Thanks for the suggestion, I have changed the code but still having trouble getting it to work. Here is my revised code:

Expand|Select|Wrap|Line Numbers
  1. Option Explicit On 
  2. Option Strict On
  3.  
  4. Imports System.Convert
  5.  
  6. Public Class frmMain
  7.     Inherits System.Windows.Forms.Form
  8.  
  9.  
  10.     Private mlblInitialValue As Double
  11.     Private mlblSalvageValue As Double
  12.     Private mlblAssetLife As Single
  13.     Private mdblTotalDepreciation As Double
  14.     Private mdblAnnualDepreciation As Double
  15.  
  16.  
  17.     mlblInitialValue = (txtInitialValue.Text)
  18.     mlblSalvageLife = (txtSalvageLife.Text)
  19.     mlblAssetLife = (txtSalvageLife.Text)
  20.  
  21.     mdblTotalDepreciation = mlblInitialValue - mlblSalvageLife
  22.     mdblAnnualDepreciation = mdblTotalDepreciation / mdblAssetLife
  23.  
  24.  
  25.  
  26.     Private Const cintCol1Start As Integer = 100
  27.     Private Const cintCol2Start As Integer = 250
  28.     Private Const cintCol3Start As Integer = 400
  29.     Private Const cintCol4Start As Integer = 550
  30.     Private Const cintColWidth As Integer = 150
  31.  
  32.     Private mfntPrint As Font
  33.     Private msngFontHeight As Single
  34.     Private msngYPos As Single
  35.     Private mfnrPrint As Font
Sep 20 '07 #3
Thanks for the suggestion, I have changed the code ...
Double-click the textbox in design to get to the TextChanged event.
Put your assignment code in there:

Expand|Select|Wrap|Line Numbers
  1. Private Sub txtInitialValue_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtInitialValue.TextChanged
  2.  
  3.    mlblInitialValue = (txtInitialValue.Text)
  4.  
  5. End Sub
  6.  
Sep 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
3
by: Mike | last post by:
Hey guys I am pulling my hair out on this problem!!!!! Any help or ideas or comments on how to make this work I would be grateful! I have been working on this for the past 4 days and nothing I do...
4
by: m.shidoshi | last post by:
I was recently put in charge of heading up my company's website, and while I have a lot of experience on the design side of things, I'm still very new to the programming side. When I started, the...
8
by: pamelafluente | last post by:
I am beginning aspNet, I know well win apps. Need a simple and schematic code example to start work. This is what I need to accomplish: ---------------------- Given button and a TextBox on a...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
0
by: alaa123 | last post by:
please i really need help to make a start I need to write an XSLT script that takes a file as its input and produces bargraph as its output the file (input) svg:svg...
1
by: jesper_lofgren | last post by:
Hello, i need to help here. I have a xmlnode as you can se below (full xml is in the bottom). I wonder how i can get the values inside the CSammanstallningLista . <CSammanstallning...
1
by: jesper_lofgren | last post by:
Hello, i need to help here. I have a xmlnode as you can se below (full xml is in the bottom). I wonder how i can get the values inside the CSammanstallningLista . <CSammanstallning Id="Omrade"...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.