![]() |
|
|
Регистрация Восстановить пароль |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
![]() |
|
Опции темы | Поиск в этой теме |
![]() |
#1 |
Регистрация: 22.03.2010
Сообщений: 7
|
![]()
Проблема такая:
В Комбобокс введены 7 компаний Каждая компания должна иметь своё значение ,т.е Amtel = 1253 примерно так... Не пойму как из комбобокса вывести значение компание в переменную и присвоить ей значение 1253... ![]() |
![]() |
![]() |
![]() |
#2 |
Участник клуба
Регистрация: 28.11.2007
Сообщений: 1,521
|
![]()
Если я правильно понял, то вот:
Код:
Всегда рад помочь!
|
![]() |
![]() |
![]() |
#3 |
Регистрация: 22.03.2010
Сообщений: 7
|
![]()
Там в одном комбобоксе 7 значений.... каждому из этих семи надо присвоить переменную... одна переменная будет равна одной сумме, другая другой и т.д
|
![]() |
![]() |
![]() |
#4 |
Участник клуба
Регистрация: 28.11.2007
Сообщений: 1,521
|
![]()
Вот пару вариантов:
Код:
![]()
Всегда рад помочь!
|
![]() |
![]() |
![]() |
#5 |
Регистрация: 22.03.2010
Сообщений: 7
|
![]()
блин(( ни одна помощь не помогла((
мне надо только чтобы название компании было равно переменной, а далее я этой переменной присвою число! Вот код программы с самого начала =) разбирайтесь =) procedure TForm1.Edit1Change(Sender: TObject); begin TryStrToInt(edit1.text,i); end; procedure TForm1.CheckBox4Click(Sender: TObject); begin CheckBox4.Tag:=q; q:=4780; end; procedure TForm1.CheckBox5Click(Sender: TObject); begin CheckBox5.tag:=w; w:=3850; end; procedure TForm1.CheckBox6Click(Sender: TObject); begin CheckBox6.tag:=e; e:=4500; end; procedure TForm1.CheckBox7Click(Sender: TObject); begin CheckBox7.tag:=r; r:=3400; end; procedure TForm1.Button2Click(Sender: TObject); begin if RadioButton1.checked and checkbox4.Checked and checkbox5.Checked then z:=(t+q+w)*i else if RadioButton1.checked and checkbox5.Checked and checkbox6.Checked then z:=(t+w+e)*i else if RadioButton1.checked and checkbox6.Checked and checkbox7.Checked then z:=(t+e+r)*i else if RadioButton1.checked and checkbox4.Checked and checkbox6.Checked then z:=(t+q+e)*i else if RadioButton1.checked and checkbox4.Checked and checkbox7.Checked then z:=(t+q+r)*i else if RadioButton1.checked and checkbox5.Checked and checkbox7.Checked then z:=(t+w+r)*i else if RadioButton2.checked and checkbox4.Checked and checkbox5.Checked then z:=(y+q+w)*i else if RadioButton2.checked and checkbox5.Checked and checkbox6.Checked then z:=(y+w+e)*i else if RadioButton2.checked and checkbox6.Checked and checkbox7.Checked then z:=(y+e+r)*i else if RadioButton2.checked and checkbox4.Checked and checkbox6.Checked then z:=(y+q+e)*i else if RadioButton2.checked and checkbox4.Checked and checkbox7.Checked then z:=(y+q+r)*i else if RadioButton2.checked and checkbox5.Checked and checkbox7.Checked then z:=(y+w+r)*i else if RadioButton3.checked and checkbox4.Checked and checkbox5.Checked then z:=(u+q+w)*i else if RadioButton3.checked and checkbox5.Checked and checkbox6.Checked then z:=(u+w+e)*i else if RadioButton3.checked and checkbox6.Checked and checkbox7.Checked then z:=(u+e+r)*i else if RadioButton3.checked and checkbox4.Checked and checkbox6.Checked then z:=(u+q+e)*i else if RadioButton3.checked and checkbox4.Checked and checkbox7.Checked then z:=(u+q+r)*i else if RadioButton3.checked and checkbox5.Checked and checkbox7.Checked then z:=(u+w+r)*i else if RadioButton1.checked and checkbox4.Checked then z:=(t+q)*i else if RadioButton1.checked and checkbox5.Checked then z:=(t+w)*i else if RadioButton1.checked and checkbox6.Checked then z:=(t+e)*i else if RadioButton1.checked and checkbox7.Checked then z:=(t+q)*i else if RadioButton2.checked and checkbox4.Checked then z:=(y+q)*i else if RadioButton2.checked and checkbox5.Checked then z:=(y+w)*i else if RadioButton2.checked and checkbox6.Checked then z:=(y+e)*i else if RadioButton2.checked and checkbox7.Checked then z:=(y+q)*i else if RadioButton3.checked and checkbox4.Checked then z:=(u+q)*i else if RadioButton3.checked and checkbox5.Checked then z:=(u+w)*i else if RadioButton3.checked and checkbox6.Checked then z:=(u+e)*i else if RadioButton3.checked and checkbox7.Checked then z:=(u+q)*i else begin if ComboBox1.Items.Strings[0]:=inttostr(x1) then x1:=30950 else if ComboBox1.Items.Strings[1]:=inttostr(x2) then x2:=32200 else if ComboBox1.Items.Strings[2]:=inttostr(x3) then x3:=34000 else If ComboBox1.Items.Strings[3]:=inttostr(x4) then x4:=35000 else If ComboBox1.Items.Strings[4]:=inttostr(x5) then x5:=36700 else If ComboBox1.Items.Strings[5]:=inttostr(x6) then x6:=37000 else If ComboBox1.Items.Strings[6]:=inttostr(x7) then x7:=38900; su:=z+x1+x2+x3+x4+x5+x6+x7; end; begin if RadioButton1.checked then showmessage('Âûáåðèòå ðàçìåð øèíû!') else if RadioButton2.checked then showmessage('Âûáåðèòå ðàçìåð øèíû!') else if RadioButton3.checked then showmessage('Âûáåðèòå ðàçìåð øèíû!') else if checkbox4.Checked then showmessage('Âûáåðèòå òèï øèíû!') else if checkbox5.Checked then showmessage('Âûáåðèòå òèï øèíû!') else if checkbox6.Checked then showmessage('Âûáåðèòå òèï øèíû!') else if checkbox7.Checked then showmessage('Âûáåðèòå òèï øèíû!'); if ComboBox1.Text = '' then ShowMessage('Âûáåðèòå ìàðêó øèíû!'); label1.caption:=inttostr(su); end; end; procedure TForm1.RadioButton1Click(Sender: TObject); begin if RadioButton1.checked then begin RadioButton1.tag:=t; t:=21300; end; end; procedure TForm1.RadioButton2Click(Sender: TObject); begin if RadioButton1.checked then begin RadioButton1.tag:=t; y:=22300; end; end; procedure TForm1.RadioButton3Click(Sender: TObject); begin if RadioButton1.checked then begin RadioButton1.tag:=t; u:=24300; end; end; |
![]() |
![]() |
![]() |
#6 |
Регистрация: 22.03.2010
Сообщений: 7
|
![]()
Решение найдено спс
|
![]() |
![]() |
![]() |
![]() |
||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
из combobox в переменную | _alis_ | Компоненты Delphi | 4 | 23.04.2010 12:08 |
Из edit в переменную | n014me | Общие вопросы Delphi | 2 | 23.03.2010 21:30 |
Загрузить в переменную | Shouldercannon | Общие вопросы Delphi | 4 | 14.12.2009 11:14 |
Не в файл, а в переменную | jocry | Работа с сетью в Delphi | 2 | 03.03.2009 11:35 |
Не могу внести строку из combobox в combobox!? | tacer | Помощь студентам | 1 | 30.11.2007 19:45 |