Using C# only, I have made a ListBox with TextBoxes (of Zone Descriptions). Works fine. How can I add Text in front of the TextBox that says Zone 1, Zone 2, etc'? I have created both TextBlocks and Strings, but can't get the Text to appear.
Printable View
Using C# only, I have made a ListBox with TextBoxes (of Zone Descriptions). Works fine. How can I add Text in front of the TextBox that says Zone 1, Zone 2, etc'? I have created both TextBlocks and Strings, but can't get the Text to appear.
This sounds like wpf
In wpf, you must have a main container, inside which you can have other stuff and even nested containers.
You should have your controls hosted in a container.
You need to show us some of your code to get more help, but you can also find a sample of that stuff here
http://stackoverflow.com/questions/9...x-with-textbox
It's not WPF. It's only C#. I use WPF for some controls, but I want to use on the fly C# for different arrangements of the screen space. My code is:
ListBox LBZoneDesc = new ListBox();
LBZoneDesc.Width = 300;
LBZoneDesc.Height = 240;
Grid.SetColumn(LBZoneDesc,0);
Grid.SetRow(LBZoneDesc,2);
ListBoxItem[] LBI = new ListBoxItem[64];
for (byte i = 0; i < 5; i++)
{
TBlkZoneDesc[i].Margin = new Thickness((i*10), 10, 0, 0);
LBI[i] = new ListBoxItem();
LBI[i].Padding = new Thickness(3);
LBI[i].Margin = new Thickness(50, 0, 0, 0);
LBI[i].Content = TBxZoneDesc[i]; // TextBox of User entered Zone Desc.
// LBZoneDesc.Items.Add(TBlkZoneDesc[i]); // TextBlock of 'Zone i'
LBZoneDesc.Items.Add(LBI[i]);
}
C0Grid.Children.Add(LBZoneDesc);