|
There are some wizard controls out there but I would use panels to do the information display. Tab is for when you want them all viewable
|
|
|
|
|
OK. Create a form, with a panel which occupies most of space, leaving enough for your buttons - lets call it panelSpace.
Create your individual panel fillers by Project...Add...NewItem... UserControl - this creates a blank panel filler - lets call it panelA. Set its Dock property to fill the panel, and place your controls.
When you want to display the items from panelA:
panelSpace.Controls.Clear();
panelSpace.Controls.Add(panelA);
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff wrote: Set its Dock property to fill the panel,
No I'm an idiot - it doesn't have a dock property - ignore that bit! Must be a tuesday again...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Thanks Original Griff for this. This works!
|
|
|
|
|
You're welcome.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Try that derived class form TabControl. It simply overrides the DisplayRectangle and adds a ShowTab Property for your new TabControl class. Does it help you ?
public class MyTabControl : TabControl
{
public override Rectangle DisplayRectangle
{
get
{
if (showTabs)
{
return base.DisplayRectangle;
}
else
{
return new Rectangle(0, 0, Width, Height);
}
}
}
#region Properties
private bool showTabs = true;
[Category("Apparence"),
Description("Indique si les onglets s'affichent."),
DefaultValue(true)]
public bool ShowTabs
{
get { return showTabs; }
set
{
showTabs = value;
RecreateHandle();
}
}
#endregion
}
|
|
|
|
|
Pyrrhon you're a Genius - your answer was exactly what I was looking for. Thank you again.
|
|
|
|
|
I'm glad to help you. Just a little thing : when you add a lot of TabPages, 2 tabpage scroll buttons appear in the TabControl. To hide them, just set Multiline=true. However I suppose you knew it.
Bye
|
|
|
|
|
Hi,
In my project I have to place the existing user controls dynamically on a form at the given location. That is I will give the X-axis and Y-axis values in the text boxes dynamically then the existing user control should be dynamically created at that location.
If any one have any idea to solve this, please reply me as soon as possible.
Thanks in advance.
|
|
|
|
|
This is quite trivial, you should buy a book and read it. The Petzold book is good in this regard.
You add the control to the form's controls collection and you set it's position.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
If using 2.0 or above you can use a generic function such as this in your form.
private void AddControl<T>(string text, Point location, Size size) where T : Control, new()
{
T control = new T();
control.Text = text;
control.Location = location;
control.Size = size;
this.Controls.Add(control);
} and call it like
AddControl<Button>("New Button", new Point(12, 12), new Size(75, 23));
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Well blinking 'eck. I never knew that Control had a text property. Just assumed it was lower down in the class hierarchy on certain controls. That's what I've learnt today.
Regards,
Rob Philpott.
|
|
|
|
|
Control has got way too many properties IMO. Deriving from it to create a new control is a PITA as you have to try and hide all the non relevant ones (and methods too) which is not only messy/time consuming but very non OOP.
If they had a IControl interface that just had the basics required, and a form's Controls property was a list of IControl it would be way better.
Something like
interface IControl : ISynchronizeInvoke, IWin32Window
{
bool Enabled { get; set; }
Point Location { get; set; }
Size Size { get; set; }
bool Visible { get; set; }
}
public abstract ControlBase: IControl
{
...
} It'll never happen though
[Edit] Made a mess of Interface with ControlBase stuff in it [/Edit]
Actually, now I've thought about it a few minutes - just the ControlBase (would need a little more than I provided so we can have OnPaint etc to override) would be enough. Give me ten minutes and I'll probably change my mind again!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Tuesday, May 12, 2009 11:20 AM
|
|
|
|
|
unless I'm missing the point entirely wouldnt it be something along these lines:
yourControl.Left = Convert.ToInt32(yourXPosTextBox.Text);
yourControl.Top = Convert.ToInt32(yourYPosTextBox.Text);
or at least thats how I position controls within a form, if you mean something else ginore me
|
|
|
|
|
Hi All,
I have a made the user control in C#,now i have faced the problem that i want to make the property in user control that pick up the data from database and display it in the list.....
Ex. ID Name
1 A
2 B
3 C
How is it possible in windows application...
Please help its urgent...
Thanks,
Lalit Narayan
|
|
|
|
|
lnmca wrote: lease help its urgent...
No, it's not at all. I asked everyone in the office, and they all agreed.
Is this homework, or paid work ? If the former, talk to your teacher so he knows how lost you are. If the latter, you're stealing from your clients. Getting data from a DB, and using it with databound controls is probably one of the most widely discussed things, in books and online. You don't go into enough detail to really know how to give an exact answer, but select * from myTable and myGrid.DataSource = myDataSet, is really all you should need to do.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
Actually, the answer is in there, you just need to be able to read, and to know something about programming. I can't write copy and paste code based on what you told us, nor would I do that for someone unwilling to learn.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Christian Graus wrote: No, it's not at all. I asked everyone in the office, and they all agreed.
|
|
|
|
|
|
Not by you, apparently....
Seriously, is google broken where you live ? Can you not read ? What I told you, IS the answer.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
lnmca wrote: Is it not possible to pick the data from database and show it in the property as in dropdownlist?
Yes.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
Hi,
I would like to be able to capture an image of an arbitrary window (though it is most likey that it will be a window I create). What is the best way to do this? I am currently using the Graphics.CopyFromScreen method to paint the section of the screen the window occupies to a bitmap but this has the obvious disadvantage that if the window is behind another, the image will also capture this overlap. Is there any other way of doing this that would solve this problem?
Thanks,
Steve
|
|
|
|