|
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.
|
|
|
|
|
|
lst2.ValueMember = "SubjectId";
lst2.DisplayMember = "SubjectName";
lst2Items.Add(lst1.SelectedItem);
|
|
|
|
|
Is there a way in c# to create a string and use that as an object or control name?
For example, if I had an object "listBox.foo", and 2 string variables "string string1 = "listBox"; string string2 = "foo";, is there anyway to build the object name from that so I could call a method like
${string1+"."+string2"}.Visible=false"
Thanks for any pointers!
I have looked at the FindControl function so I could do "mycontrol = FindControl(string1+string2); mycontrol.Visible=false". However, although I use System.Web.UI, the compiler still complains that it's not available in the context.
|
|
|
|
|
Like this:
string x = "control_name";<br />
this.Controls[x].Visible = false;
जय हिंद
|
|
|
|
|
Hi friends, i got a problem with connecting data of controls to a database at runtime.
First, i wanted to create "n" number of textbox controls at runtime. And it was successful.
Secondly, i wanted to store content or data of the textboxes to my database, the problem is since the controls of Textbox are going to be created at runtime, how can i represent the value(data) of those textboxes at runtime ?
Example: if i need to create 3(n == 3)textboxes and wanted to store their data into my table.
Insert into table1 values(text1.text, text2.text, text3.text);
if( n == 5)
Insert into table1 values(text1.text, text2.text, text3.text, text4.text, text5.text);
Girmay
|
|
|
|
|
What is the criteria which governs the number of textboxes? What is the structure of table1?
जय हिंद
|
|
|
|
|
I am getting the following message box whenever I try to debug the code.
“The following module was built either with optimization enabled or without debug information:”
“To debug this module, change its project build configuration to Debug mode.
To suppress this message, disable the ‘Warn if no user code on launch’ debugger option”
I have built the entire code in Debug mode and no where I have enabled the optimization setting.
I am using Microsoft Visual Studio 2008.
I am using the C# .NET for the very first time please help me out in this.
|
|
|
|