|
Sorry for that i forget to mention that you must override
ToString() as above response told you
I modified the original post
MCAD
-- modified at 14:24 Thursday 1st September, 2005
|
|
|
|
|
Hi,
I am drawing a line and I would like to draw an arc on the line based on the input angle given. The start point and the end point of the arc should be between the lines. The bubble should be bulgy as and when the degrees increases.
Advance Thanks to everyone.
|
|
|
|
|
Hello
After some methematics recall here is the code:
int length = int.Parse(lengthBox.Text);
float angleDeg = Math.Max(0.0f, Math.Min(90.0f, float.Parse(angleBox.Text)));
float angleRad = angleDeg * (float)(Math.PI / 180);
Graphics g = this.CreateGraphics();
Pen pen = new Pen(Color.Red, 1);
int x = 10;
int y = 150;
g.DrawLine(pen, x, y, x + length, y);
int r = (int) (((double) length / 2) / Math.Sin(angleRad));
int h = (int) (Math.Cos(angleRad) * r);
g.DrawArc(pen, x - (r - length / 2), y - (r - h), r * 2, r * 2, -90 + angleDeg, -2 * angleDeg);
pen.Dispose();
g.Dispose();
With best regards,
Andrew
|
|
|
|
|
Thanks Andrew. Excellent formula.
|
|
|
|
|
Thanx Andrew for the help u have provided.
|
|
|
|
|
how i use interbase database in .net window programing
i need tutoria l of this database..
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
|
|
|
|
|
Hi,
I have one dataset with two tables, in these tables parent table is related with child table by one column.
I have defined DataRelation object for binding data from these tables into datagrid.
When I bind a dataset with datagrid, the relations between tables are visible as links, on clicking link we can see child table's record. I don't want to display links of datarelations in datagrid.
AllowNavigation property of datagrid doen't work.
Can some one tell the solution?
Thanks
|
|
|
|
|
I have a DataView (dvUnsorted) and I want to sort it by the values in an integerlist(iSortedList), witch responds with the values in the Column "itemID" in dvUsorted.
My idëe is to create a new Column (colSort), and ad the apropiaded value of the items index
in that cell.
So if I have a int[] list = {4,2,66,7}
My dvUnsorted will look someting like this
itemID col1 col2
66 ..
2 ...
7 ..
4 ..
dvUnsorted with the added column "colSort" will lock something like this.
itemID col1 col2 colSort
66 .. 3
2 ... 2
7 .. 4
4 .. 1
and then I youst sort the dvUnsorted by
dvUnsorted.Sort = "colSort ASC";
My code locks something like this
<br />
private DataView dvSortedItems(int[] iSortedList, DataView dvUnsorted)<br />
{<br />
dvUnsorted.Table.Columns.Add("colSort");<br />
for(int i = 0; i < iSortedList.Length; i++)<br />
{<br />
}<br />
dvUnsorted.Sort = "colSort ASC";<br />
return dvUnsorted;<br />
} <br />
So what I need is to find the row where "itemID" = iSortedList[i]
How Can I find that row in the DataList?
If theres someone with a better idëe to sort a DataView by an int[], I would be happy to know.
Thanks
Thomas
|
|
|
|
|
I've found a way
<br />
private DataView dvSortedItems(int[] iSortedList, DataView dvUnsorted)<br />
{<br />
dvUnsorted.Table.Columns.Add("colSort");<br />
for(int i = 0; i < iSortedList.Length; i++)<br />
{<br />
foreach(DataRowView drv in dvUnsorted)<br />
{<br />
if(drv.Row["itemID"].ToString() == iSortedList[i].ToString())<br />
{<br />
drv.Row["colSort"] = i;<br />
break;<br />
}<br />
} <br />
}<br />
dvUnsorted.Sort = "colSort ASC";<br />
return dvUnsorted;<br />
}<br />
|
|
|
|
|
dear helper.
i wrote an ms word Add-in with C#.(comman bar addin)
after installation it work well in my compuer.
but when i want to install this addin in another system with .net framework 1.1 isn't work (maybe it install truly but there isn't any item added to the msword Command bar).
what's the problem.(how can i solve this problem.)
tank's in advance.
rashidi.
|
|
|
|
|
hi!
I want to link every item in listbox to a picturebox in my database,so that items of my listbox are fields in table of my database that have addresses in other column. I build a dataset for listbox with this instruction:
select [temp name] from temp where [temp type]='page'
How can I read contains of address field in my table ?
when I use this code:
dataset.temp.address_column.tostring()
don't resd contains of my address field and yhis string be "address".
please help me,by the way what event can I use for listbox to show pictures
and my table fields are (temp name,temp type,address);
tanx.
Leila Azizkhani
-- modified at 3:10 Thursday 1st September, 2005
|
|
|
|
|
i got a project with a lot of forms.I want this forms to be childs of a parent form.How can I do this thing .Actually I want to transform my project in a MDI..Tank you
|
|
|
|
|
|
Hi,
Anyone knows if there're any sample applications using H.263 or H.323 for audio streaming? Appreciate your help... Thanks!
Cheezo =)
|
|
|
|
|
Greetings,
I'm a classic ASP developer of some years, but a C# noob. I've got a wild hair to write a windows app. I'm trying to convert the code in the excellent "managed shell link" article here:
http://www.codeproject.com/useritems/managed_shell_link.asp
to work with URL links. I've created a copy of the code, and made some changes...namespace to Pvax.URL, class name URLLink, and changed the CLSID_ShellLink line to:
private static readonly Guid CLSID_InternetShortcut = new Guid(0xFBF23B40, 0xE3F0, 0x101B, 0x84, 0x88, 0x00, 0xAA, 0x00, 0x3E, 0x56, 0xF8);
and updated the two references to CLSID_ShellLink to the new constant. But it's not working. Are the IShellLinkA/W calls invalid for URL links? MSDN indicates that internet shortcuts implement the IShellLink interface. Any suggestions?
ehollar
|
|
|
|
|
Hi,
I'm trying to create a simple framework to handle standard DialogBox display, I wish to be able to lock control on the form to avoid moving of the control at design time of course this functionality should work with visual inheritance. At one point a was looking to put these controls private on the base form but I don’t think this is a useful solution since I will need to do more work to publish useful property and reroute event handling properly.
So I have tried to override the fallowing function:
new public Point Location
protected override void OnLocationChanged(EventArgs e)
protected override void OnMove(EventArgs e)
Without success.
Any one as any clue or direction I could try to solve this problem.
Oh yes, you may also think that I’m a bit crazy to do thing like that, yeah maybe but the fact is that we have more than 15 developers that are creating dialog box for a really big application and they have not bean able to get the exact same sizing and behaviour for each of their dialog box and that fact cost us a lot of maintenance for all kind of little stupid thing.
Thanks.
(define Email (lambda ()
elacroix@devmesh.com))
Im not a church numeral im a free variable
|
|
|
|
|
I've had VB .NET classes, but I'm trying to learn C#. Apparently C# doesn't have an inputbox. I added a reference to Microsoft.VisualBasic.dll and tried to use the inputbox from there, but I have a couple of problems.
I get this:
Some code.
It doesn't matter what I've tried to do, I even tried the prompt, title, and default value. I always get no overload method for inputbox takes "n" arguments. Please help.
|
|
|
|
|
that's because that method takes 5 parameters and in C# there is no such thing as optional parameter, so you have to pass all of them.
public static string InputBox(
string Prompt,
[Optional] string Title,
[Optional] string DefaultResponse,
[Optional] int XPos,
[Optional] int YPos
);
|
|
|
|
|
Thank you for your reply. I'm having trouble getting the inputbox centered.
Here's my points (x , y): (this.Right / 2, this.Bottom / 2)
|
|
|
|
|
Hey folks,
May be this is a stupid question I am pretty new to C#.
I just wonder how can I call a static method using late binding. For example, I have a class with a private constructor and a static method.
Is it possible? if yes, then how?
Thanks a bunch.
|
|
|
|
|
It's possible, you just have to specify BindingFlags.Static
Type type = typeof(SomeType);
MethodInfo method = type.GetMethod("SomeStaticMethod", BindingsFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod);
method.Invoke(null, new object[]{});
|
|
|
|
|
Hi all,
¿Is it possible to compile 2 assemblies and making reference one to each other?
Example:
We want to compile MySoftware.exe and MyLibrary.dll, we do it as follow:
csc.exe /target:winexe /out:MySoftware.exe /reference:MyLibrary.dll
csc.exe /target:library /out:MyLibrary.dll /reference:MySoftware.exe
I want both assemblies to access the other assembly methods but at compile time is obviously that the other file does not exist, so compile error displays.
Thanx
|
|
|
|
|
A solution (but not the best) is to build a stupid MyLibrary.dll with the needed public class, but without implementation.
<br />
public class MyLibraryClass<br />
{<br />
public int ComputeSomething(int l, int r)<br />
{<br />
throw new NotImplementedException();<br />
}<br />
}<br />
Than build the exe against this stupid Library. Than build the real Library against the exe.
I have not tested this solution.
If you try it, please write your result.
Good luck.
Lars Niedziolka
|
|
|
|
|
Heinz Suez wrote:
csc.exe /target:library /out:MyLibrary.dll /reference:MySoftware.exe
You should not reference an executable. MSDN says: "At run time, you should anticipate that only one .exe assembly can be loaded per process, even though, there may be times when more than one .exe might be loaded in the same process. Therefore, do not pass an assembly built with /target:exe or /target:winexe to /reference. This condition may be modified in future versions of the common language runtime."
To solve your problem. Try either to move all functionality needed by MyLibrary into MyLibrary, so it can be compiled without referencing, or maybe create a second library that gets referenced by MyLibrary and MySoftware.
www.troschuetz.de
|
|
|
|
|
I am working on a project.One phase of it is to extract each frame from AVI movie and process it.In Visual C++ i have used the vfw32.lib to get frame.Now i am doing work in C#.Is there any library having built in functions to do the same thing or there is a way to use vfw32.lib in C#.My major task is to read each frame,store it onto Bitmap object and then do scanning whatever required
|
|
|
|