|
I am looking for ways to write text along a bezier curve but I haven't found any, is there anyone who has done this and possibly give me some ideas on how to achieve this or point me in the right direction.
I have so far figured out how to get the points along the curve (I know how to calculate the pts using a formula, could not find an API in GDI+ that could give me this) but writing text along the curve involves more since the text itself must be rotated to get the right effect.
Thanks
Bhanu
|
|
|
|
|
I need to incorporate a Query By Example Grid in my application, something along the lines of those used in MS Access where the user can enter the criteria in a grid and an SQL statement is generated depending upon that grid.
Before I start on the process does anyone know if such aleady exists - seaching Codeproject for "QBE" found no results
Thanks
|
|
|
|
|
I'm working on a dockable forms/controls project. How does one get that "pin"-like icon to be displayed on a dockable MDI form / control? I'm talking about the icon immendiately to the left of the "X", in the top right corner of, say, the Soultion Explorer window, Properties window, etc.
|
|
|
|
|
|
|
Probably easy answer but here goes.
How do I go about returning a variable name versus the value of the variable?
<br />
public struct Test {<br />
<br />
public string member;<br />
<br />
}<br />
<br />
Test obj = new Test();<br />
string member = "hello";<br />
<br />
obj.(member); <- obviously this is illegal but bare with me<br />
<br />
How could I have the variable name "member" (not the value "hello") be interpreted as if I manually wrote obj.member
|
|
|
|
|
I think you can get what you want using typeof.
|
|
|
|
|
No, typeof returns the System.Type of the specified type. For example, if you have a class named Foo,
class Foo { .. }
Type theFooType = typeof(Foo);
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
|
Plese help me to display a small dialog box(combobox ) wherein the user can specify the name of a dial-up connection from his system.
Vlada Nesic
|
|
|
|
|
For some reason ResxResourceWriter class is not availble for me in System.Resources namespace. However, I do see ResourceWriter and IResourceWriter. I'm using .Net 2003 on 2003 Server which has both .Net 1.0 and 1.1 installed. My primary framework is 1.1 . I dont think 1.0/1.1 should make difference since the class was available since v1.0.
Any suggestions?
Thanks,
- Malhar
|
|
|
|
|
This may sound like a stupid question, but is your project something other than a Windows Forms app?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No such thing as a stupid qstn. But you're correct. My application is a Library (DLL) project which will be used by an used as a reference by UI (Windows Forms) project.
|
|
|
|
|
OK. You're probably missing the reference to System.Windows.Forms.dll.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You know I said "there is no such thing as a stupid question". I was wrong. My initial question was really stupid!! .
I added "using System.Resources" but overlooked that it belongs in the System.Windows.Forms.Dll assembly. I was expecting that the Resources related stuff should be common and not be part of Win forms!!
Anyways, thanks much for your help.
- Malhar
|
|
|
|
|
Hi everybody!
I'm currently working on a class that has some public properties of type double . For some of them i have to restrict the set accessor, so that only values greater 0 can be assigned. Currently I'm ignoring an assigned value that is smaller 0
public double Alpha
{
set
{
if (value > 0)
this.alpha = value;
}
}
but I'm not really happy with this solution, cause the user has no feedback if the value specified by him is really assigned. Is it good practice to add an else-block and throw an ArgumentOutOfRangeException there? If so, should i offer some method to check if a double value would be valid for alpha or some static min and max fields?
Thanks in advance!
www.troschuetz.de
|
|
|
|
|
You can add a bool variable which indicate if the value has been assigned.
Like this:
<br />
public double Alpha<br />
{<br />
set<br />
{<br />
if (value > 0){<br />
assigned = true;<br />
this.alpha = value;<br />
}<br />
}<br />
}<br />
But im not sure i got your question!
I hope it helps..
VentoEngine corp.
Program your life ^^
|
|
|
|
|
This is a design decision that depends on many factors. However, generally speaking, if it were me and this variable was exposed to the user via the UI, I would put my "feedback" mechanism directly into the UI rather than putting it into the class itself.
That is, if the user defined this value in a textbox, for example, I would write the textbox in such a way that it simply would not allow the user to enter an incorrect value. I would then put something into the help file to explain the behavior. I think that is better than cluttering up your classes with a lot of exception crap and the UI with pop up warning boxes etc.
|
|
|
|
|
At first thanks for the answer.
The class I'm writing is part of a class library, so the variable may be exposed to the user via GUI but didn't necessarily have to. So I'm searching for a way, to let an user of the class check for validity of an assigned value no matter if it happens directly in code or via GUI. Currently I favor the following solution:
public double Alpha
{
set
{
if (value <= 0)
throw new ArgumentOutOfRangeException("Assigned value has to be greater 0");
this.alpha = value;
}
}
public bool IsValidAlpha(double value)
{
return value > 0;
}
}
if (obj.IsValidAlpha(1.0))
obj.Alpha = 1.0;
else
...
www.troschuetz.de
-- modified at 5:41 Thursday 1st December, 2005
|
|
|
|
|
One solution indeed could be to throw an exception when an invalid value is entered.
But you should capture this error in the user interface before the data is entered into the model you are using.
The exception is only for the other developers that use your model in their applications.
WM.
What about weapons of mass-construction?
|
|
|
|
|
At first thanks for the answer.
The class I'm writing is part of a class library, so I don't write a GUI myself. I'm searching for a way, to let an user of the class check for validity of an assigned value no matter if it happens directly in code or via GUI. Currently I favor the following solution:
public double Alpha
{
set
{
if (value <= 0)
throw new ArgumentOutOfRangeException("Assigned value has to be greater 0");
this.alpha = value;
}
}
public bool IsValidAlpha(double value)
{
return value > 0;
}
}
if (obj.IsValidAlpha(1.0))
obj.Alpha = 1.0;
else
...
www.troschuetz.de
|
|
|
|
|
You should be calling IsValidAlpha from within the setter instead of duplicating the code.
|
|
|
|
|
|
Hi:
I want to give an arbitrary number of arguments/parameters to a method and have it modify the arguments. C# says I cannot combine params and ref in the method decleration.
Please could someone suggest what I should do?
Thanks, Sam
|
|
|
|
|
Throw the objects you want to pass inside an array or ArrayList (or List<> if you're using .NET 2.0). Pass the array or list as an argument, where you can then modify the elements of the array/list.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|