473,480 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB 2005 Newbie Questions

2 New Member
Hi All,

Sorry for these really pathetic questions, but I have been playing on VB 2005 today, and I am stumped.

First question

I have created a sub to calculate the difference in days of 2 datepickers and for the result to be displayed in a text box, but I cant get the result to display until I click in the text box and press a key...is there a way to generate the result without an event? The code I have used is as follows:

Dim date1 As New Date
Dim date2 As New Date
Dim difference As TimeSpan

date1 = DateTimePicker1.Value
date2 = DateTimePicker2.Value

difference = date1.Subtract(date2)

textbox1.text = difference.totaldays.

Lastly (for now)

I have created a combo box which contains 3 items, is there a way to get a result populated into a text box varying for each choice.

For example

First class (result in text box = £50.00)
Second Class (result in text box = £60.00)

Etc..

Many thanks in advance.

Alex
Nov 23 '06 #1
2 2649
Taftheman
93 New Member
Hi All,

Sorry for these really pathetic questions, but I have been playing on VB 2005 today, and I am stumped.

First question

I have created a sub to calculate the difference in days of 2 datepickers and for the result to be displayed in a text box, but I cant get the result to display until I click in the text box and press a key...is there a way to generate the result without an event? The code I have used is as follows:

Dim date1 As New Date
Dim date2 As New Date
Dim difference As TimeSpan

date1 = DateTimePicker1.Value
date2 = DateTimePicker2.Value

difference = date1.Subtract(date2)

textbox1.text = difference.totaldays.

Lastly (for now)

I have created a combo box which contains 3 items, is there a way to get a result populated into a text box varying for each choice.

For example

First class (result in text box = £50.00)
Second Class (result in text box = £60.00)

Etc..

Many thanks in advance.

Alex
Firstly try refreshing your text box

textbox1.refresh

and

try adding indexs to the combo box
Nov 23 '06 #2
alexandercowan
2 New Member
Firstly try refreshing your text box

textbox1.refresh

and

try adding indexs to the combo box

hi, thanks for your response, how would i add indexes to the combo box?
Nov 23 '06 #3

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

Similar topics

6
2113
by: sathyashrayan | last post by:
Following are the selected thread from the date:30-jan-2005 to 31-jan-2005. I did not use any name because of the subject is important. You can get the original thread by typing the subject...
4
1198
by: Shawn | last post by:
Hi. When I started using VS.NET 2003 there was no problem upgrading all my projects to VS.NET 2003 Framework 1.1. Everything worked as it used to under framework 1.0. Is it easy to upgrade from...
11
1192
by: Brian | last post by:
Hello, In Web Matrix, I am able to work on a single ASPX file and double click on a control and it will take me to the subroutine so I can code the button. In Visual Web Developer, if I do the...
2
1374
by: CK | last post by:
Previously in Sql Server 2000, we would be in enterprise manager, you'd double click on a view, and a nice little dialog box opened with the t-sql statetments, there was also a check sql syntax and...
13
2095
by: josh | last post by:
I'm pretty new to both sql 2005 and VB but please bear with me. I have installed SQL 2005 express on a Windows 2003 Standard server. I have also installed VB 2005 Express edition on the server. SQL...
2
2078
by: kress1963nov22 | last post by:
I recently purchased a good MS book ("Build a Web Site Now") by Jim Buyens. It has the Express Edition of MS-Visual Web Developer 2005 on CD and also MS SQL Server 2005 Express Edition on the CD. A...
10
27989
by: Nicholas Zhou | last post by:
Sorry if this sounds stupid. I am a total newbie.... Can I compile C program in Visual Studio 2005 IDE? I wrote the simple "Hello World" program in it: ------------------------------------ ...
0
979
leafgreen
by: leafgreen | last post by:
Hey everyone. Thanks for helping me with these two super-simple newbie questions. I use DW8. 1. On this page http://adswebsite.net/yahoo-search-versus-google-adwords, on the right column where it...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
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...
1
6758
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
5362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3011
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3003
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.