473,406 Members | 2,345 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,406 software developers and data experts.

Need help on homework (I'm just learning)

TO DO TASK

Need help with programming the ADD button

I have a textbox called txtinput where I will enter a task

After hitting an add button the program should put the text into a listbox called lstoutput

for example read a book


but also will need to be numbered

for example

1. read a book
2. write a report

Thanks for any help

AMY
Dec 13 '06 #1
3 1271
TO DO TASK

Need help with programming the ADD button

I have a textbox called txtinput where I will enter a task

After hitting an add button the program should put the text into a listbox called lstoutput

for example read a book


but also will need to be numbered

for example

1. read a book
2. write a report

Thanks for any help

AMY
OK found the way to get txtInput to lstOutput

Now I need to count each input in the list box
Dec 13 '06 #2
OK found the way to get txtInput to lstOutput

Now I need to count each input in the list box
Use ListCount method

Example

List1 --> ListBox

List1.ListCount
Dec 13 '06 #3
Sorry I do not understand this is what I have so far

Public Class FrmToDoList
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents lblInput As System.Windows.Forms.Label
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents lstOutput As System.Windows.Forms.ListBox
Friend WithEvents txtInput As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.lblInput = New System.Windows.Forms.Label
Me.txtInput = New System.Windows.Forms.TextBox
Me.btnAdd = New System.Windows.Forms.Button
Me.lstOutput = New System.Windows.Forms.ListBox
Me.SuspendLayout()
'
'lblInput
'
Me.lblInput.Location = New System.Drawing.Point(16, 8)
Me.lblInput.Name = "lblInput"
Me.lblInput.Size = New System.Drawing.Size(40, 21)
Me.lblInput.TabIndex = 0
Me.lblInput.Text = "Task"
Me.lblInput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'txtInput
'
Me.txtInput.Location = New System.Drawing.Point(72, 8)
Me.txtInput.Name = "txtInput"
Me.txtInput.TabIndex = 1
Me.txtInput.Text = ""
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(192, 8)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.TabIndex = 2
Me.btnAdd.Text = "Add"
'
'lstOutput
'
Me.lstOutput.Location = New System.Drawing.Point(16, 48)
Me.lstOutput.Name = "lstOutput"
Me.lstOutput.Size = New System.Drawing.Size(256, 108)
Me.lstOutput.TabIndex = 3
'
'FrmToDoList
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 14)
Me.ClientSize = New System.Drawing.Size(288, 173)
Me.Controls.Add(Me.lstOutput)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.txtInput)
Me.Controls.Add(Me.lblInput)
Me.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "FrmToDoList"
Me.Text = "To Do List"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click



lstOutput.Items.Add(txtInput.Text)
txtInput.Text = ""




End Sub













Private Sub FrmToDoList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class ' FrmToDoList
Dec 13 '06 #4

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

Similar topics

31
by: Fred Astair | last post by:
I used this site for a c++ homework assignment that my teacher left me no clue on how to do it. http://www.betterteachers.com. Check it out. Fred
17
by: EkteGjetost | last post by:
This is definitely not the smart thing to do as far as my learning goes, but desperate situations call for desperate measures. The final lab for my introduction to C programming class is due...
34
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
15
by: carr4895 | last post by:
Hello. I was wondering if someone could help me too with a login form. Upon startup, I have to display a password screen and it should accept a user name and password. User name can be anything...
19
by: ern | last post by:
I need a FIFO queue of size 20, to keep track of a running average. Once the queue is full with 20 values, I want to take the sum/20 = AVERAGE. Then when a new value comes in, I want: (Old Sum...
31
by: Martin Jørgensen | last post by:
Hi, I've had a introductory C++ course in the spring and haven't programmed in C++ for a couple of months now (but I have been programmed in C since january). So I decided to do my conversion...
9
by: Kodiak | last post by:
I am trying to write some javascript code in which you enter some text in one text box and the text will also appear in the second text box. For example, if I write the word "Test" both text boxes...
5
by: emre esirik(hacettepe computer science and enginee | last post by:
/////////////////////// DIVISION FUNCTION //////////////////// void div ( int pol1 , int pol1p , int pol2 , int pol2p) { int r=5,z,i,g,j,k,l,dividend,rising={0}; for (i=0 ; i<6 ; i++)...
8
by: garyrowell | last post by:
I have been at this programme for hours trying to work out what is wrong. Any help would be very much appricated. Here is the breif I received. The program This week you are going to write three...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.