| View previous topic :: View next topic |
| Author |
Message |
NoManchesPuto I post too much
Reputation: 0
Joined: 24 Jan 2009 Posts: 2820
|
Posted: Mon Apr 20, 2009 5:15 am Post subject: [Delphi 7] Need basic coding help please. +rep and credits |
|
|
I need a code/function that will send a selected item in a listbox to an edit so i can edit that code. Then i need a code that will send it back to the listbox from the edit. I will rep whoever can help me and will give them credit, also a basic function is ok i can edit it to fit. Thanks. _________________
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 20, 2009 6:59 am Post subject: |
|
|
be a bit more specific
its sounds like you want to take and item from an itemlist to an edit box
should be very easy
the selected item of the list
what the item contains
| Code: | | value := listBox.Items[index] |
retrieve what the item contains
from there put the text into an edit box and add a button or something which will put the string back in place
| Code: | edit1.text := value;
listBox.Items[index] := edit1.text; |
havent done delphi for ages _________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Mon Apr 20, 2009 7:56 am Post subject: |
|
|
Snootae, Is your code equal to mine?
| Code: | private void uberGet()
{
int index = listBox1.selectedIndex;
textBox1.Text = listBox1[index].ToString();
}
private void uberSet()
{
int index = listBox1.selectedIndex;
listBox1[index].ToString() = textBox1.Text;
} |
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 20, 2009 8:30 am Post subject: |
|
|
yeh pretty much, i was just trying to explain it to him cos he doesn't sound knowledgable, but that will probably help him cos im sceptical my code will work  _________________
|
|
| Back to top |
|
 |
NoManchesPuto I post too much
Reputation: 0
Joined: 24 Jan 2009 Posts: 2820
|
Posted: Mon Apr 20, 2009 12:58 pm Post subject: |
|
|
Sorry, i am a bit new to coding in general, i am advancing quite well i might add, anyways the meaning of my post/thread was to ask for a code that will send 1 item(not a particular one) from a TListBox to a TEdit, i have found a code earlier today to send it back from the TEdit, it is as follows : | Code: | | listBox1.Items.add(edit1.Text); | but i'm not sure as to how i would write one that would do the opposite Can you help me please
For a visual explanation, here is what i am trying to create, all of the buttons work except the "Send To Editor". _________________
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 20, 2009 10:08 pm Post subject: |
|
|
didnt even read all that stuff i said
and the exact code was posted
| Code: | int index = listBox1.selectedIndex;
textBox1.Text = listBox1[index].ToString(); |
| Quote: | | 1 item(not a particular one) |
what do you mean by that, you have to have a reason for using this item _________________
|
|
| Back to top |
|
 |
|