PDA

View Full Version : Help ComboBox


mediatel
04-28-2008, 07:24 PM
Hi!!
e.g:
i have ComBobox:
.Open PDF File
.Jumpe to Page5
.OpenURL

When i select item 1, it open a pdf file.
When i select item 2, it jump to page5.
When i select item 3, it get an url.
My english is not good. I hope you understanding!
Thank you!

RizlaUK
04-28-2008, 07:31 PM
when you post a project you need to export a ".apz" file, do this by going to the main menu, click file>>export and follow the instructions

now, to your problem

replace the code in your combobox "On Select" event with the below code

-- Get the selected index
local selected = ComboBox.GetSelected("ComboBox1");
-- Get the data of the selected entry
local data = ComboBox.GetItemData("ComboBox1", selected);
if selected == 1 then
-- open pdf
File.Open(data, "", SW_SHOWNORMAL);
elseif selected == 2 then
-- jump page
Page.Jump(data);
elseif selected == 3 then
-- visit website
File.OpenURL(data, SW_SHOWNORMAL);
end

mediatel
04-29-2008, 11:43 AM
Thanks it works fine. :yes