|
I don´t have ideia how to do this, but, use the attribute [Description("your text here")] and override the propertygrid to use this.
|
|
|
|
|
While it may make you feel good to see a 'human readable' name for your property, you may want to consider NOT doing that purely for design reasons: The purpose of the PropertyGrid is to reflect exactly the state of the object as reported by its properties.
Giving it a human readable name obscures which actual property it is reflecting (and although it may just be the same name with spaces, the point remains - the purpose of the property grid is to list the *Properties* of the object).
|
|
|
|
|
The main reason to use the space in the propertygrid is that i have an visual application used to generate a command line script, the command lines have a lot of parameters, at least 17 parameters. and i found, by using the propertygrid, it's very easy to manage this parameters. Actually, the application works normally right now,but i'd like to add this function to it.
in SQL 2005 i notes that, you can find it here:
http://home.arcor.de/sql2005/2_SQL-Login/140_SQL_byStudioCsharp/051_WhoKonwsWhatHasToBeChangedHere.jpg
it's an advanced properties dialog
Thank very much
|
|
|
|
|
The property grid exposes everything via reflection and parameters. So you need to carefully name your visible properties in PascalCase to make the names as readable as possible. In the Description() attribute, include the full name and help text.
|
|
|
|
|
i have a vb 6 activex dll and i am able to run a form inside of the dll is it possible to do the same thing in csharp ( run a form from a dll) or is there no UI in csharps DLLs?
Thanks,
Chad Aiena
|
|
|
|
|
You can just wrap up your form inside the DLL. As the form is just another class, you can pretty much do what you want with it (well, within reason).
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
can you give me a quick code snip of how i would put it in the dll (sorry i am still learning csharp)
or something like this but how to i show it
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace dllform
{
public class Class1
{
Form test = new Form()
}
}
Thanks,
Chad Aiena
|
|
|
|
|
I'll tell you how to do one for yourself. Start off by developing a form in the designer as an executable. You can then change the application type to DLL in the project properties. Compile it up and you have a form inside a DLL.
Next, create a new project and reference the DLL. Then, in your code you just need to call the form. To do this (assuming your form is called MyDllForm in the namespace MyNamespace):
MyNamespace.MyDllForm form = new MyNamespace.MyDllForm();
form.Show();
I hope that helps.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm using the VS 2005 control System.Windows.Forms.WebBrowser. I want to be able to track button clicks. If I've navigated from a page with multiple buttons, how can I tell which button was clicked?
|
|
|
|
|
|
Hi I've an application in which I use tiff images (scanned ) through Microsoft Office Document Imaging and save them,while closing the application invaribly I get error that "Application referenced memory which is invalid Click on Ok to terminate the application"
Which is usual in windows. I'm disposing all the objects I think before closing so what more could be done to remove it? Or Whats the cause for this and what could prevent it?
Thanks in advance.
Don't Quit
|
|
|
|
|
Hi!
I use VS 2005, and C#. If framework 1 and framework 2 installed, in a project I use only .net 1 compatible thinks, but when I compile the executable, and transfer it to a machine witch haven't got .net 2, gon erro message.
How can I adjust my project to require only .net 1?
Thanks for help.
|
|
|
|
|
Unfortunately for you, VS 2005 targets .NET 2 only. In other words, you can't develop .NET 1 applications with it. What you could do is to create an installer for your application which installs the .NET Framework 2 Redistributable on the client.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Really ?
I thought that by changing some setting (I would guess inside AssemblyInfo.cs or maybe
in a manifest file)
one could tell .NET that the preferred version would be 2.0 but if that was not available
.NET 1.1 (or 1.0) could be used instead.
Of course as soon as some 2.0 specific feature would get accessed, it would throw when
running on 1.x
I dont know the details but would like to know more about it...
Greetings,
Luc Pattyn
|
|
|
|
|
There is a way of doing it, but it means that you have to compile up outside of Visual Studio. VS2005 uses the .NET 2 compiler.
Providing that you haven't used any of the .NET2 features such as partial classes etc..., then you can actually compile the application from the command line using the .NET 1.1 csc.exe compiler. It's not neat, but it does work.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I hate to swear in a forum where most people use Visual Studio but here goes...
How about SharpDevelop? It can target either .net 1.1, .net 2.0, Boo and Mono.
It can also import projects from Visual Studio.
It doesn't claim to be a replacement for VS but maybe it's worth a try.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
|
Why do get get a new form each time I create a new instance?
public class Form1
{
...
method to handle 'next' button to next graph
graphnumber++;
switch (graphnumber)
case 1: dg1 = new DrawGraph1();
dg1.Draw();
break;
case 2: dg2 = new DrawGraph2();
dg2.Draw();
break;
etcetera
...
}
public class DrawGraph : Form1
{
//abstract method Draw();
public class DrawGraph1 : DrawGraph
{
//override method Draw();
public class DrawGraph2 : DrawGraph
{
//override method Draw();
etcetera
This is probably so basic that books about C# won't even mention it, still I find this a significant problem!
Ranger...
Beginner
|
|
|
|
|
Ranger49 wrote: Why do get get a new form each time I create a new instance?
Your new instance of DrawGraph1 or DrawGraph2 is a Form1 (which I expect is a Form ). What else would you expect to happen when you instantiate a DrawGraph1 or DrawGraph2 ?
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: Your new instance of DrawGraph1 or DrawGraph2 is a Form1 (which I expect is a Form). What else would you expect to happen when you instantiate a DrawGraph1 or DrawGraph2?
My problem here was that I couldn't get my subclasses to work if I didn't put a ': Form' behind the class DrawGraph :
So when my DrawGraph class doesn't inherit from Form1 that then there wouldn't be a new window opened at each new instance of DrawGraph?
Ranger...
Beginner
|
|
|
|
|
Ranger49 wrote: So when my DrawGraph class doesn't inherit from Form1 that then there wouldn't be a new window opened at each new instance of DrawGraph?
Correct.
/ravi
|
|
|
|
|
Hello!
Again I am getting the error message "member names cannot be the same as their enclosing type"
I have a class Matrix which is public. And I am wondering if C# lets a class like Project return a Matrix as it is instanced.
Last time I had this problem it had to do with certain variables not being public. But in this example there are so few variables that I figure I got all my bases covered.
What did I overlook or forget to consider?
Ranger...
public class Project
{
// Project: member names cannot be the same as their enclosing type
public Matrix Project(double Rx, double Ry, double distance)
{
return new Matrix
(
Math.Cos(Ry),
0.0,
Math.Sin(Ry),
0.0,
Math.Sin(Ry) * Math.Cos(Rx),
Math.Cos(Rx),
-Math.Cos(Rx) * Math.Sin(Rx),
0.0,
0.0,
0.0,
0.0,
0.0,
(Math.Sin(Ry) * Math.Cos(Rx)) / distance,
-Math.Sin(Rx) / distance,
-(Math.Cos(Ry) * Math.Cos(Rx)) / distance,
1.0
);
}
Beginner
|
|
|
|
|
Ranger49 wrote: What did I overlook or forget to consider?
I think it's complaining that the Project class can't have a property or method called Project .
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: I think it's complaining that the Project class can't have a property or method called Project.
I know, but why? I mean to create a new instance of a class you make a method with the same name as the class right? This should work...
Ranger...
As it is this code source went from about 1.75 page to almost 4 pages and this was the only error I got. It is my inexperience that I don't know why this is.
|
|
|
|
|
Ranger49 wrote: I mean to create a new instance of a class you make a method with the same name as the class right?
Correct. That method (the constructor) is never specified with a return type. You're attempting to define a constructor for Project that returns a Matrix .
I recommend renaming the method to CreateMatrix() or something similar.
/ravi
|
|
|
|