vb.net containers and dynamic buttons vs Xojo equivalent

Hello,
I am new to Xojo. I am playing with it to see how easy it would be to move away fro vb.net. So i hope someone could help.

In Vb.Net (or .net in general) they have containers e.g. Table Layout containers which allows me to neatly stack dynamic buttons. So my questions are:

  1. What is the equivalent of table layout containers in Xojo?
  2. I have been playing with controlsets from the various posts on the forum. Seems a bit silly to create a control and then clone it via a control set (from what i have read, must admit i don’t fully understand yet how Xojo does things differently) This is what i do in .net via a while loop
Dim ItemButtons As New Button 'put it in the loop so you create a new button each time
With ItemButtons

	.Text = sqlReader("Description").ToString()
	.Top = 10 + (5 * CInt(sqlReader("idx")) )
	.Left = 25 + (1 * CInt(sqlReader("idx")))
	.Name = sqlReader("idx").ToString
	.Font = New Font(ItemButtons.Font.Name, 10, Font.Style.Bold)
	.ForeColor = Color.SteelBlue
	.Width = 136
	.Height = 91
	
End With

What is the equivalent of this in Xojo?

You can use the containers and embedwithin!!

link

Have you looked at the controlsets example? Examples->Desktop->Controls

There’s a manual for Xojo available online: http://developer.xojo.com/userguide
and as a PDF in your Xojo install folder inside the one titled Documentation!

Some great resources to read before you get started.

  1. There is no out-of-the-box equivalent of TableLayoutPanel in Xojo.

  2. I may be wrong but I have not seen With… End With statement in the Xojo examples and References. You have to specify the object names in every line.

XOJO does not support WITH/ENDWITH (wish it did)

Thank you all! Appreciate the replies. Sadly the functionality I am looking for does not seem to exist :frowning:
@Wayne Golding yes i did, was the first example i looked at. but still requires 1 control(s) to exist which is not what i want, even if i hide the first control en unhide it still not practical compared to other languages, but i will keep trying, maybe i can get a work around going :slight_smile:

There are two ways in Xojo : the control set one, or place the control on a ControlContainer and instanciate the ControlContainer.

I am not the only one coming from VB, but if I had a suggestion, it is to embrace the Xojo way, instead of trying to shoehorn Xojo into VB shoes. All you will get is frustration.

The ContainerControl could also be what you need to replace Table Layout.

Containers are incredibly powerful and we use them all the time. You can add them at design time or you can embed them at runtime. I feel they are, perhaps, the most powerful item in Xojo. We don’t use control sets very often because I think they’re more hassle than they’re worth but to each their own.

I will reiterate what Michel is saying. To shoehorn Xojo into VB is going to lead to frustration and anger when it’s not warranted. Try to figure out the Xojo way because in the long run it will produce a much better application and greatly reduce your frustration. Yes, there is a learning curve with Xojo.

Since you’re new I’ll say that I have over 65 hours (200+ videos) of Xojo training available at http://xojo.bkeeney.com/XojoTraining/. Most projects come with project files you can use in your own projects. As of today we’ve streamed over 10,141 hours of video via our Xojo web app (unknown number of hours before that change).

Agree … CC’s are to be used all the time, since you make everything only once and you can simply embed them on a canvas for example and have a scrolling form.

I disagree to this one, since controlsets can reduce repeating code in for example MouseEnter, MouseExit etc. events. You need to be careful working with index, but it’s stays a powerful technique.