473,327 Members | 1,952 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,327 software developers and data experts.

Can you take specific text from a textbox and input it into a messagebox?

I have a messagebox that asks if I want to delete a specific ebook from my listbox.
The message says, "“Do you want to remove the x eBook?” the x needs to be the title of the book selected.
This is what I have:

Expand|Select|Wrap|Line Numbers
  1.     Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click
  2.         ' removes the selected line from the list box
  3.         Dim x As String = lstEbooks.Text()
  4.  
  5.         If MessageBox.Show(“Do you want to remove the " & 
  6.                         x & " eBook?”,
  7.                        "eBooks", MessageBoxButtons.YesNo,
  8.                         MessageBoxIcon.Warning,
  9.  
  10.                          MessageBoxDefaultButton.Button1) 
  11.                          = DialogResult.Yes Then
  12.  
  13.             ' if a line is selected, remove the line
  14.             If lstEbooks.SelectedIndex <> -1 Then
  15.                 lstEbooks.Items.RemoveAt(lstEbooks.SelectedIndex)
  16.             End If
  17.         End If
  18.     End Sub 
Each line in the textbox has Title, Author, and Price
So, my x is showing Title, Author, and Price.

Examples:

Textbox shows:
Allegiant Veronica Roth 3.99
Divergent Veronica Roth 2.99

My message is showing:
Do you want to remove the Allegiant Veronica Roth 3.99 eBook?

What I want is: Do you want to remove the Allegiant eBook?

Please, any suggestions?

Thanks
Apr 9 '17 #1
0 1060

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

Similar topics

5
by: Massy | last post by:
Does anyone know how can ensure that the only input that is accepted into a textbox is a numeric (only digits 1-9 accepted) Is this possible I am using vb.net to create a windows app thx...
0
by: ramnaresh_t yadav via .NET 247 | last post by:
Hi, I am pasting the code to import data from Text/Excel files into Database(Oracle ) Table... I think some one needs this .. they can use.. it... ======================= Dim dsDB As New DataSet...
2
by: Matt | last post by:
Hi, I'm ridiculously new to Access (about a week!) so please be patient! My database is a record of British Standards. Each has a unique identifier. Some are split into parts. I would like...
6
by: Rancid Buttchutney | last post by:
I guess the subject says it all, really, and I know it's not a standard of the feature-set, but has anyone experimented with it? I'm writing an autocompleting INPUT element and would like it to...
13
by: so many sites so little time | last post by:
say i want spacing in my text so instead of doing <br> <br> in between the lines or having to do <href = or <a href = for a link what could i do to have php enter to mysql or retrive it formated?
1
by: Don Croner | last post by:
I am using access 2003 with windows xp. I have created a data base for to keep track of my 180 employees. I have created a table with 21 records. Then I created a form to input employee data. I...
1
by: sandhyamn | last post by:
hi...i am trying to write a programme for uploading file with jsp using multipart/form data.it's working.....but the problem is i can't write the textbox values into a file....if change the form...
2
by: Dave Almighty | last post by:
I've spent the last couple of hours looking desperately through every corner of the internet for a solution to the following question (and my teeth have been ground down almost to nothing). With a...
2
by: dpw.asdf | last post by:
I have been searching all over for a solution to this. I am new to Python, so I'm a little lost. Any pointers would be a great help. I have a couple hundred emails that contain data I would like to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.