|
|
What's the best practice for C# Forms for the above? Thanks.
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
I had this problem and I don't know if I took the best approach but I used flowlayoutpanels a lot using percentages and always maximized my form.
probably not the best approach but it worked, you can get max size using System.Windows.Forms.SystemInformation.PrimaryMonitorSize property
|
|
|
|
|
In what way? Is this a dialog form or a window form? Will the computer in question have multiple monitors? If so, will they be different sizes (that's the way my setup is)?
You need to ask the question a different way.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for your time.
What I would like to happen is that say in my development machine which is 1680x1050 my form displays in a certain way. If the application is deployed in a machine of lower resolution I would like say all the controls in the form to adjust proportionally (i.e. height, width, spaces in between).
cheers,
swjam
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
If you want to scale *everything* by the same amount the brute force way is to get the screen resolution of the target computer and multiply the size/position parameters of everything by the ratio of your resolution to theirs.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
I would design the form to fit within a "lowest acceptable size", and then allow the form to be re-sized. Each control would have an appropriate anchor setting. This will be quite tricky to get just right, but it should be possible.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You can use AutoScaleMode property
|
|
|
|
|
Before .NET I solved this problem "by hand". I arranged the controls to look ok at the lowest acceptable resolution. Then for higher resolutions I had extra space in the X and Y directions.
I allowed selected controls to "grow" by a percentage of this extra space. For example, my button controls ignored extra space, but a list box would use it to show more of its information to the user.
I also defined rows and columns of controls that would keep the same space between them even when one or more of those controls grew.
With docking and anchoring you can often come up with a simpler solution in .NET.
|
|
|
|
|
Hello friends,
I want to ask is it better to implement SIP protocol in C# instead of java means to say ,is it easier and reliable ?
Thanx in advance
messages sent here
|
|
|
|
|
That largely depends on the programmer, not the language. Easiest way would be a third-party component for the language of your choice
|
|
|
|
|
Both the languages are extremely vast and useful. You will find help on both of them and can do it in both the way you like.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
I would say it's easier (mainly asynchronous stuff, is much easier in C#)
|
|
|
|
|
Hi All
Here is the code below
// List view items starts here.
ListView listView = new ListView();
listView.Bounds = new Rectangle(new Point(3, 16), new Size(900,900));
// Set the view to show details.
listView.View = View.Details;
// Allow the user to rearrange columns.
listView.AllowColumnReorder = true;
// Display check boxes.
listView.CheckBoxes = true;
// Select the item and subitems when selection is made.
listView.FullRowSelect = true;
// Display grid lines.
listView.GridLines = true;
listView.Visible=true;
listView.Columns.Add("File Name", 100, HorizontalAlignment.Center);
listView.Columns.Add("File Location", 100, HorizontalAlignment.Center);
listView.Columns.Add("File size", 100, HorizontalAlignment.Center);
// Add the ListView to the control collection.
this.Controls.Add(listView);
The text in first column header is aligned to left although i have aligned it to center.
The text in other two columns header is aligned to center as set by me.
How can i make the text in first column header to aligned centerally.
Thanks in advance
|
|
|
|
|
The first column in a listview is always aligned to the left, regardless of what you set it to. There is no option to change this.
If you want a centered first column, use a DataGridView instead.
|
|
|
|
|
I have a DataGridView and a ToolBar.
I wish to have the user navigate through the DataGridView using 'previous' and 'next' buttons on the toolbar. The buttons should move the dataGridView selectedItem accordingly.
However, I can't find how to do this (I'm new to c#). Any pointers would be much appreciated.
|
|
|
|
|
|
Thanks for that.
But, what if I didn't want to use a Binding Navigator?
|
|
|
|
|
Listen, if you dont get the answer post in my profile i post you the code for that later
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hello
I was just wondering how do attributes in interface's members work.
I mean, if I put an attribute in a property, for example:
[BindableAttribute()] <br />
int PropertyName { get; set;}
Will it propagate the attribute through inheritance without having to type again the attribute when implementing the interface code?
thanks in advance.
|
|
|
|
|
You will also need to implement the properties when implementing the interfaces like:
protected string m_PropertyName;
public string PropertyName
{
get
{
return m_PropertyName;
}
internal set
{
m_PropertyName = value;
}
}
So, it is expected that you will implement the get and set in derived classes
|
|
|
|
|
Thanks but I do know that I need to implement the properties accessors code, what I wanted to learn is whether I have to explicitly implement the attribute too(the BindableAttribute in this case) each time again even if I put it in the interface.
|
|
|
|
|
Sorry for the misunderstanding Mr. Candyman. Am not exactly sure whether you have to still implement the attribute too.
|
|
|
|
|
Have you tried it? It would seem this is very easy to confirm with a 5 minute test-app.
|
|
|
|
|
Here you go, A simple test app.
class Program
{
static void Main(string[] args)
{
ExecTest(typeof(ITest));
ExecTest(typeof(Test));
Console.ReadLine();
}
static void ExecTest(Type type)
{
PropertyInfo prop = type.GetProperty("PropertyName");
if (prop == null)
throw new InvalidOperationException("invalid type - must have PropertyName property");
object[] attrs = prop.GetCustomAttributes(typeof(DefaultSettingValueAttribute), true);
Console.WriteLine("Number of DefaultSettingValueAttribute's on '{1}': {0}", attrs.Length,type.Name);
}
public class Test : ITest
{
#region ITest Members
public string PropertyName
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
#endregion
}
public interface ITest
{
[DefaultSettingValue("test")]
string PropertyName { get; set; }
}
}
|
|
|
|