|
1. Even if the controls are important you can create a wizard sort of User Interface by logically breaking up controls on several screens.
2. You can either create controls at runtime at some instance and then creating adding controls to your form dynamically. This will speed up your form initialization because you are not creating all 100-150 controls at form load.
hope it helps....
best regards,
Hatim Ali.
|
|
|
|
|
hi,
Defanitly it won't help me. My interface, that is the interface that i am going to show is the final out for the user. I can't make any sort of updation or customiztion in my controls list or my interface. This is the way it is working.
I have a small doubt to ask you.
Suppose if you want to show few date values for two months. What you will do ?. Here you need to know one more thing that, you need to show all date value at a time.
anyhow thanks for sharing my this problem
Sreejith Nair
|
|
|
|
|
You have a choice. Either redesign your interface so it is more organized, even if it means duplicating information on sub-forms, or leave it as is. There's nothing else you can do about this. You simply have way too many controls on a single form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
im trying to use the image.saveadd function to save a group of gif images in a single file, the problem is that this function has Encoderparameters parameter and i dont know how to use it, does anybody know how to use the saveadd function or anything about the encoderparameter class?
huda
|
|
|
|
|
Hello,
how is it possible to rename an XmlNode in a DOM implementation like XmlDocument or XPathDocument?
XmlNode node;
node.Name = "abcdef";
This would be very simple but the Name property is Read-Only...
thanks
pete
|
|
|
|
|
It's not allowed to change a node's name, although I'm not to sure why..... You can only add a new Node with, for example the old node's content and with the desired name, after which you delete the old node.
i.e.
<br />
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();<br />
doc.LoadXml("<Test><Testing>content</Testing><Test>");<br />
<br />
System.Xml.XmlNode oldNode = doc.SelectSingleNode("/Test/Testing");<br />
<br />
System.Xml.XmlNode newNode = doc.CreateElement("NewTest");<br />
newNode.InnerXml = oldNode.InnerXml;<br />
oldNode.ParentNode.AppendChild(newNode);<br />
doc.RemoveChild(oldNode);<br />
|
|
|
|
|
//I came across this trick by accident. works like a charm and ridiculously simple.
XmlDocument myXml;
myXml.Load(myXmlNode); //Not sure if this will work, but you get the idea
myXml.InnerXml = myXml.InnerXml.Replace("<OldName", "<NewName").Replace("</OldName>", "</NewName>");
//or if you know name is unique in the node
myXml.InnerXml = myXml.InnerXml.Replace("OldName", "NewName");
"I have found the paradox that if I code until it hurts, then there is no hurt, but only more code". Mother Teresa (if she were a coder)
|
|
|
|
|
hi,
I need a global store for storing error messages. It could be done using singleton.
Now whats the difference between the following two.
1. Implement singleton pattern.
2. Creat a class. Make its contructor private. Expose the functionality using static functions.
In singleton pattern a single object is created but in 2nd approach no object is created. Which approach is better ??
Thanks...
|
|
|
|
|
If there is no explicit need for an object instance, I find the use of all static members simpler. If you want to use it to persist data using the framework's builtin serialization, then you would need an object.
|
|
|
|
|
how do you use system.xml to read and write xml files directly....not by loading them into a dataset.....
|
|
|
|
|
You can either use XmlDocument Class or XmlTextReader / XmlTextWriter Classes for reading/writing XML other than dataset.
hope it helps
|
|
|
|
|
|
i was wondering if anyone could tell me how to create and use dll's in .net
|
|
|
|
|
class library is what you are asking...
|
|
|
|
|
The concepts and terminology has changed with .NET. We no longer have to fiddle with a DLL/EXE/COM Components etc. Read about the concept of ‘assembly’
If you are using MS Visual Studio .NET 2003, create a new project of type ‘Class Library’ Thats your DLL. In the project create you classes and methods. All these will be accessible to the consumer of the DLL. (The consumer has to ‘Add reference’ of the created DLL in his/her project to consume your classes)
|
|
|
|
|
Does anyone know how to [easily] obtain the color of a GroupBox caption when themes are active? (A .NET 2.0 specific solution is acceptable.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I wrote some code to show data from access using datagrid. However, when I try to update or delete data, it always report error that Dynamic SQL generation for the UpdateCommand or DeleteCommand is not supported against a SelectCommand that does not return any key column information. However, when i add data, it is fine.
private OleDbDataAdapter adapter;
private DataSet ds;
private DataTable table;
private DataForm form;
private TextBox[] txtBox;
private OleDbCommandBuilder builder ;
try
{
adapter = new OleDbDataAdapter("select * from CMA",
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=datainfo.mdb");
builder = new OleDbCommandBuilder(adapter);
ds = new DataSet();
adapter.Fill(ds);
dataGrid1.DataSource = ds;
table = ds.Tables[0];
dataGrid1.SetDataBinding(table, "");
this.dataGrid1.CaptionText = "Table: CMA";
}
catch(OleDbException ex)
{
MessageBox.Show(ex.Message);
}
private void OnDeleteData(Object sender, EventArgs e)
{
for(int i=0;i
|
|
|
|
|
The error says it all: it's unable to generate a SQL expression for UpdateCommand and DeleteCommand because your SelectCommand doesn't include key data. Running UPDATE and DELETE expressions requires either 1) your primary key, or 2) some other data that only you could determine to be unique. A primary key is always unique, so the SQL builder requires key data. Of course it isn't needed for InsertCommand because you're adding data; your key may be an identity column that is automatically filled so the SQL builder doesn't care.
There are two options: select your primary key column(s) for your SelectCommand , or don't use the SQL builder and define the commands yourself.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
|
I am spent all day that I am trying to rid the box look like ... on propertygrid from keep from activate editor collection. I tried to look internet and no luck. I tried to use
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.None;
}
but it wont trigger. please help me about this situation. please show me with example source if neccessary. ThankS!!
|
|
|
|
|
For what object? Is this on an object you define, or for another? It's impossible to answer this object without knowing what type of object your setting to PropertyGrid.SelectedObject and whether or not it's a type that you've defined.
If you've defined it, then you have total control over your properties (but not necessarly properties of your properties' property types). If not, there are still some things you can do depending on what type of object it is.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath Stewart wrote:
you have total control over your properties (but not necessarly properties of your properties' property types).
Ok, is it me or is that just funny if you try and say that 10 time really fast?
- Nick Parker My Blog | My Articles
|
|
|
|
|
He probably got the poor guy confused as hell.
|
|
|
|
|
propertyGridPart.SelectedObject = partInfo;
sorry about lacked of details that I explained my previous details. I just found the article that I am looking for http://www.codeproject.com/cs/miscctrl/customizingcollectiondata.asp?df=100&forumid=16073&fr=51#xx546899xx[^] , but it still dont solve my problem. you noticed on Fig. 5: Edit collection content that it has been red circle. I want that button gone or not appear that button at all. I tried everything to get rid that frigging button but no luck. I tried to use [Editor(typeof(MainDialog),typeof(UITypeEditorEditStyle))] and
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.None;//I cant get anything
//to trigger this part
}
I have no idea how can I fix this problem. just explain it how to stop that frigging buttn appear. Thanks in advance
|
|
|
|
|
The problem is that the Type of the property warrants an editor, so you need to attribute your property (which takes precedence over the attribute on the property Type) with an editor that doesn't do anything:
using System;
using System.Drawing;
using System.Drawing.Design;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.PropertyGrid propertyGrid1;
private System.Windows.Forms.RadioButton radioButton1;
private CustomRadioButton radioButton2;
private System.Windows.Forms.GroupBox groupBox1;
public Form1()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new CustomRadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
this.propertyGrid1.CommandsVisibleIfAvailable = true;
this.propertyGrid1.LargeButtons = false;
this.propertyGrid1.LineColor = System.Drawing.SystemColors.ScrollBar;
this.propertyGrid1.Location = new System.Drawing.Point(8, 88);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.SelectedObject = this.radioButton1;
this.propertyGrid1.Size = new System.Drawing.Size(280, 264);
this.propertyGrid1.TabIndex = 0;
this.propertyGrid1.Text = "propertyGrid1";
this.propertyGrid1.ViewBackColor = System.Drawing.SystemColors.Window;
this.propertyGrid1.ViewForeColor = System.Drawing.SystemColors.WindowText;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(8, 16);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(160, 24);
this.radioButton1.TabIndex = 1;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "BackgroundImage ...";
this.radioButton1.CheckedChanged += new System.EventHandler(this.switchObject);
this.radioButton2.Location = new System.Drawing.Point(8, 40);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(160, 24);
this.radioButton2.TabIndex = 2;
this.radioButton2.Text = "No BackgroundImage ...";
this.radioButton2.CheckedChanged += new System.EventHandler(this.switchObject);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(280, 72);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(296, 365);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.propertyGrid1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "Example";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void switchObject(object sender, System.EventArgs e)
{
RadioButton radio = sender as RadioButton;
if (radio != null && radio.Checked) this.propertyGrid1.SelectedObject = radio;
}
}
class CustomRadioButton : RadioButton
{
[Editor(typeof(CustomRadioButtonImageEditor), typeof(UITypeEditor))]
public override Image BackgroundImage
{
get
{
return base.BackgroundImage;
}
set
{
base.BackgroundImage = value;
}
}
class CustomRadioButtonImageEditor : UITypeEditor
{
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.None;
}
}
} Pay attention to the BackgroundImage property in the PropertyGrid when selecting the different options.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|