Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hy in my project i have 1 listbox and three forms in my first form i add lisbox
second one and third one same
when i add item to listbox if form1 textbox1 is empty then listbox item added and copy listbox item name in form1.textbox1
if form1.textbox1.text is full or form2.textbox1 is empty then listbox item added and copy listbox item name in form2.textbox1
else msgbox
this is my code but not working

VB
Dim new_item As String = InputBox("New Value" & vbCrLf & "NOTE:- Insert Value Must Have One Letter" & vbCrLf & "Otherwise Your Value Is Not Add", "New " & _
   "Value")
If Not ListBox1.Items.Contains(new_item) And new_item.Length > 3 And Form17.TextBox1.Text = "" Then
    Clipboard.SetText(new_item.ToString)
    Form15.ComboBox3.Items.Add(new_item)
    ListBox1.Items.Add(new_item)
    Form17.Show()
    Form17.TextBox1.Text = My.Computer.Clipboard.GetText

ElseIf Not ListBox1.Items.Contains(new_item) And new_item.Length > 3 And Form18.TextBox1.Text = "" Then
    Clipboard.SetText(new_item.ToString)

    Form15.ComboBox3.Items.Add(new_item)
    ListBox1.Items.Add(new_item)
    Form18.Show()
    Form18.TextBox1.Text = My.Computer.Clipboard.GetText
Else
    MsgBox("Item Not Added:-")

plz help
Posted

It is better to use a parameterized constructor New(ByRef myString As String) to create forms and pass your string in form object instead of copying it to clipboard there is a chance of data loss

Eg: Dim objForm1 As New(myString) Form1;

public sub New(ByRef myString As String)

Me.Textbox1.Text=myString

End Sub
 
Share this answer
 
Not One know My Answer
please help me its urgent
 
Share this answer
 
Comments
Blutfaust 23-Apr-14 10:19am    
Hm, complaining after less than 25 minutes isn't very polite. No one here gets paid to help others. They are all volunteering and complaining could even decrease their motivation to help you.
[no name] 23-Apr-14 10:19am    
No it is not at all urgent. We are volunteers and answer when we can. Besides that, we would have no idea at all what you think "not working" means.
Member 10746031 23-Apr-14 10:25am    
bro problem is when i add item in listbox if form17.textbox1.text is full then Item Added and change form17.textbox.text to item.text
not added in form18.text

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900