Thanks guys! Now I can name and place Combos at will.
The next thing I would like to do is to update the ComboBox properties from the program calling the creation procedure. My first attempt was This,oComboBox1.rowsourcetype = '1 (value)' but it fails (This can only be used within a method)
i also wish for a way to see all the properties of the created object. I have read that some can only be accessed if a custom class has been defined but I don't understand why that would be the case or how to figure out what should be accessible.
Any help would be appreciated, Joe
On Tue, Jun 18, 2024 at 5:42 AM juergen@wondzinski.de wrote:
You should do it differently:
toForm.AddObject(cName, "ComboBox") With toForm.&cName .AddItem(Item 1") .AddItem("Item 2") .Top = nTop .Left = nLeft .Visible = .T. Endwith
wOOdy
-----Ursprüngliche Nachricht----- Von: ProFox profox-bounces@leafe.com Im Auftrag von Joe Yoder Gesendet: Dienstag, 18. Juni 2024 02:33 An: profoxtech@leafe.com Betreff: Combobox followup
Thanks Eric for the input. I think I have correctly made the changes you suggested but the code fails with "Unknown member oComboBox" Here is the code as I have it now:
- Procedure to add a ComboBox to the form PROCEDURE
AddComboBoxToForm(toForm, nTop, nLeft, cname) LOCAL oComboBox oComboBox = CREATEOBJECT("ComboBox") oComboBox.AddItem("Item 1") oComboBox.AddItem("Item 2") toForm.oComboBox.Top = nTop toForm.oComboBox.Left = nLeft toForm.oComboBox.Visible = .T. toForm.AddObject(cname, "oComboBox")
ENDPROC For some reason I need to go to the archive to get any responses to my post so this will appear as a new thread.
Thanks again, Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]