|
|
hi,
i would to guide the user trough an input routine.
it's like the setup routine of a program installation.
On the first Page the user has to agree the license.
On the next select components to install, then the install path and so one.
how can get something like this? i've to ideas..
1. create a single form for each step and switch between these.
2. create a lot of panels with the controls on it and make all accept of one invisible.
is there a better option?
maybe a controll like the tabcontrol without the tabs
or a multy layer panel ?
thank you!!..
|
|
|
|
|
What you need is to take the wizard approach. No, I'm not talking Harry Potter, but boring old code.
You will need:
0. Some panel controls. One panel for each step.
1. A back button
2. A forward button
3. A finish button
4. A cancel button.
Now - izzy wizzy let's get busy - write some code to show and hide the panels and Robert's your Mother's Brother.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
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. 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
|
|
|
|
|
I wouldn't take this approach for a wizard type form. The cost of creating and destroying the controls outweigh any benefit. It is better to create them all up front with the form load and show or hide as needed.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I would. The cost is pretty irrelevant at run time (since it is a user event we respond to the time costs are immaterial, and the memory cost is not exactly massive). The developer cost of show / hide is a lot more than maintaining separate pre-loaded panels, I think.
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
|
|
|
|
|
There is an overhead and also another design consideration.
For the OP this does nto mater, but in general the UI and the data should be seperate. If you use databinding beween the data and UI then adding panels on the fly requires updating the databinding on the fly.
As for the extra complicatedness of show and hide [used to play that when I was younger; but that's another story] what is so hard? You have the panels in a collection and you iterate through making only one of them visible. peasy!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Six of one; half a dozen of the other.
A personal preferance in the end, I think.
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
|
|
|
|
|
Hi
In my windows application i am receiving data's from serial port
and storing it in database (SQL2005). I am displaying the data in gridview, currently i am using a button to update and view database.
Now what i need is to display updated datas in gridview with out the button
thanks in advance
|
|
|
|
|
u ca use timer to refresh the data periodically
rahul
|
|
|
|
|
Though, timer can be one of the option but I would recommed to use Manual Reset Event[^] to it.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I just want to print and I've got the code msdn http://msdn.microsoft.com/en-us/library/aa287528(VS.71).aspx[^]
private void button3_Click(object sender, EventArgs e)
{
printDocument1.Print();
}
private void printDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
PaintEventArgs myPaintArgs = new PaintEventArgs(e.Graphics, new Rectangle(new Point(0, 0), this.Size));
InvokePaint(dataGridView1, myPaintArgs);
}
When I clicked at button 3 ,I got just only page and nothing in side
What's wrong with my code
|
|
|
|
|
I am using vs2003, c#.net.
In my application am using picture box control, and creating some tiff files.
Now when this tiff file got created i am loading it in picture box.
using Image.FromFile method.
Now on Save option i am saving this tiff file to user specify location.
after that i want to delete the file of picture box, so i am setting
pictureBox.Image = null;
//code for deleting the file
But its not working, how can i delete the file?
any comment/help appreciated !!
regards
|
|
|
|
|
I believe the previous call still holds an active handle. Can you scope it or replace it by a MemoryStream equivalent so that the active handle can be overcome?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
I have met the same problem,But I used this code to solve the problem
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
PictrureBox.Image=Image.FromStream(fs);
fs.Close();
then you can delete the image file.
|
|
|
|
|
Hello,
I am using DataGridViewComboBoxColumn type column in my DataGridView. I have assigned data source to List<myobject>. I have set displayMember and ValueMember for the combo.
Now i want to assign default value to display initially but it is giving error "Default Error Dialog" saying wrong input to cell. I found it is because of different displayMember and ValueMember property values.
How should i assigned default value so it display as user wants?
Thanks a lot.
|
|
|
|
|
Have you tried the following sample code:
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 0) // your DataGridViewComboBoxColumn index
{
e.Value = "Default value";
}
}
tbhattacharjee
|
|
|
|
|
What is IEEE 754 format number? how to convert a float decimal number to single precision (4 byte) IEEE 754 format number?
Thanks!
|
|
|
|
|
IEEE 754 format number[^]
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
|
|
|
|
|
hi all,
i have an object where some data store as
foreach(var obj in listbox.items)
{
MessageBox.Show(obj.ToString());
}
display as
{SubjectId = 1,SubjectName =Art1}
how can get only SubjectId from this object.
thanks.
modified on Monday, May 18, 2009 1:48 AM
|
|
|
|
|
obj must be having a property for SubjectID. Use it.
जय हिंद
|
|
|
|
|
may you explain too.
|
|
|
|
|
How are you adding items to this listbox?
|
|
|
|
|
Don't be silly, 'adding stuff' is in year 2 of the course!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|