Visual studio on click

Posted on 2008-11-02
Medium Priority
Last Modified: 2013-11-26

I am just starting to use visual studio, can anyone give me an example of code that returns values to a list box on the click of a button. I'm not bothered what the values are just won't to see how its done?

Question by:ac_davis2002
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 13

Expert Comment

ID: 22861960

Author Comment

ID: 22861977
I will take a look, i am trying to use vB2005 do you have any examples using that?
LVL 13

Expert Comment

ID: 22861997
VB2005 with ASP.NET or desktop applications ?
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

LVL 13

Expert Comment

ID: 22862029
with asp.net/VB.Net you can do something like this
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="ListBox_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
    <asp:ListBox runat="server" ID="lstbxTest">
    <asp:TextBox runat="server" ID="txtTest"></asp:TextBox>
    <asp:Button runat="server" ID="btnAdd" Text="Add" />

==============CODE BEHIND=======================

Partial Class ListBox_Default
    Inherits System.Web.UI.Page

    Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        lstbxTest.Items.Add(New ListItem(txtTest.Text, txtTest.Text))

    End Sub
End Class


Author Comment

ID: 22862040
sorry I'm using windows applications

I really just want to see a command to populate a list box with values, do I need to use asp to do this?
LVL 13

Accepted Solution

sm394 earned 2000 total points
ID: 22862072

drop a listbox and button control on windows form
then on click event of button
do this
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    End Sub

Author Closing Comment

ID: 31512503
cool thanks!!

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question