|
-
Mar 6th, 2009, 08:52 PM
#1
Thread Starter
Lively Member
[2005] Creating an organizer
Well, I've came up with a clever little idea of mine to make an organizer for myself for my classes. I don't really feel like explaining how exactly it works so I've included a picture, you should get the idea.

I've added random labels of random classes as a test. When the add button is clicked, combobox1 and textbox1 become visible. In the scenario that "English" is selected from the combobox, whatever is entered into the textbox will go directly into listbox1 since listbox1 is right under English. Here's the code.
Code:
1 Dim text As String
2 text = TextBox1.Text
3 ComboBox1.Visible = True
4 TextBox1.Visible = True
5 Select Case True
6 Case ComboBox1.SelectedItem = "English"
7 If text <> "" Then
8 ListBox1.Show(text)
9 End If
10 End Select
11 End Sub
I know where the error is but I dont know what to do to fix it. What do i fix in line 8?
-
Mar 6th, 2009, 10:53 PM
#2
Thread Starter
Lively Member
Re: [2005] Creating an organizer
Nevermind my previous post, i changed the listboxes to all textboxes and it works. I just want to know, how do i enter 2 separate lines of text without the previous line disappearing?
-
Mar 7th, 2009, 02:11 AM
#3
Re: [2005] Creating an organizer
Hi,
Make your textbox multine = True in the properties of your textbox.
Wkr,
sparrow1
-
Mar 7th, 2009, 12:30 PM
#4
Thread Starter
Lively Member
Re: [2005] Creating an organizer
 Originally Posted by sparrow1
Hi,
Make your textbox multine = True in the properties of your textbox.
Wkr,
sparrow1
It already is. It still doesn't go to the next line. I probably have to add some coding for it as well but I have no idea what it is.
-
Mar 7th, 2009, 03:41 PM
#5
Re: [2005] Creating an organizer
When you set the textbox value, you need to keep the previous value:
Code:
TextBox1.Text = TextBox1.Text & Environment.NewLine() & "Next Value"
or more succinctly:
Code:
TextBox1.Text &= Environment.NewLine() & WebBrowser1.StatusText
-
Mar 7th, 2009, 05:06 PM
#6
Thread Starter
Lively Member
Re: [2005] Creating an organizer
Thanks guys but after playing around some more, i got everything to work with listboxes which makes everything easy. One question i still have is, how do i make a new window pop up when i click the add button, and i dont mean a message box.
-
Mar 7th, 2009, 05:09 PM
#7
Re: [2005] Creating an organizer
Create a new form object. Then you can create an instance like this:
Code:
Dim f as New Form2()
f.ShowDialog()
-
Mar 7th, 2009, 05:19 PM
#8
Thread Starter
Lively Member
Re: [2005] Creating an organizer
How do i create a new form object?
-
Mar 7th, 2009, 05:21 PM
#9
Re: [2005] Creating an organizer
Add a new form to your project. Right click on your project and select add->Windows Form.
-
Mar 7th, 2009, 05:30 PM
#10
Thread Starter
Lively Member
Re: [2005] Creating an organizer
K got it! How do I link the forms together?
-
Mar 7th, 2009, 05:31 PM
#11
Re: [2005] Creating an organizer
Just to point out what was wrong with line 8:
ListBox.Show() simply makes the listbox visible after you use .Hide(). Also you can't put text in between the () as the command has no parameters.
I'm guessing you wanted to add "text" to the ListBox's items. In that case you would simply use ListBox1.Add(text).
Also I highly suggest you don't use the variable "text" as your program will confuse it for Me.Text which will randomly change the Title Bar text of your program. Just adding a random letter to the begging, such as "ctext" will solve that problem.
-
Mar 7th, 2009, 05:32 PM
#12
Re: [2005] Creating an organizer
 Originally Posted by knicksfan426
K got it! How do I link the forms together?
What do you mean by "link"? You can't really link forms, if you want to show one on the click of a button, just use the name of the form and .Show().
-
Mar 7th, 2009, 05:36 PM
#13
Thread Starter
Lively Member
Re: [2005] Creating an organizer
I want the information that was entered into the textbox in form2 to go into the listbox that is in form1. Thats why i wanna link.
-
Mar 7th, 2009, 05:38 PM
#14
Re: [2005] Creating an organizer
Expose a property on Form2 that is public. Then after the show dialog, you can access that property and do whatever you want with it.
-
Mar 7th, 2009, 05:42 PM
#15
Thread Starter
Lively Member
Re: [2005] Creating an organizer
What do u mean "Expose a property on Form2 that is public."?
-
Mar 7th, 2009, 05:51 PM
#16
Re: [2005] Creating an organizer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|