|
Sounds like your making a graph. Well, whatever it is, you could easily write a translation function. I don't know what the properties and function names are, but the following pseudo-code should give you the idea
Point TranslatePoint(Point p)
{
Point q;
q.x = p.x;
q.y = Window.Height - p.y;
return q;
}
|
|
|
|
|
Look at Graphics.Transform property. This will help you specify a tranformation matrix that you can use.
I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. - Bill Sergio about posting in the right forum. The Lounge - June 23, 2002
|
|
|
|
|
Well what i'm gonna use it for is just to play around with some basic game physics (very basic).
I'm quite new at C# so I din't know if there was a funktion that could alter the coordinate system of the form, like in vb...
I just figuered that it would be the easist approch.....
Well thanks again....
|
|
|
|
|
Hallo everybody...
Is there anyone who knows a place where I can find out something about the conventions, such a variable naming....
|
|
|
|
|
There are two convention style for vb / c#
camelCase: <- justLikeThis
and
PascalCase: <- JustLikeThis
in vb & c# we dont use strange names. just use long names if it make sourcecode easy to understand. dont use ALL_CAPS_WITH_UNDERSCORES. in mfc people use the m_ prefix with all vars buts its m_difficult m_tootype m_like m_this.
|
|
|
|
|
yes, in/on MSDN
|
|
|
|
|
Hi all,
Can I put a ComboBox into ListView? If possible, please let me know the way to do it.
Thanks very much.
|
|
|
|
|
I dont quite get what you are trying to do.
But i think your trying to do something like the properties window in visual studio.
There is a control called PropertySheet, you can try it out.
|
|
|
|
|
On a form I have a treeView control on the left and an empty panel at the right.
An ArrayList holds 100 instances of a control I've made in another class.
On every "AfterSelect" event fired from the treeView, a control from the ArrayList is added to the panel,according to the index of the selected node. When the user selects another node, the previous control is hiden via "this.panel1.Controls.Clear()" and the new one is added via "this.panel1.Controls.Add(control)".
These controls I add and clear have a button on them. Now here is the problem:
If the user selects node 1, then node 2, then clicks the x button of the form, the form disposes normally.
If the user selects node 1, then click the button on control 1, then selects node 2, then clicks the clicks the x button of the form, the form does not dispose (the event is never fired.)
If the same scenario as above is followed, but before clicking the x button the user selects node 1 again, (then click x button) the form disposes.
The button click from the controls do nothing! (there's no code there).
Has anyone any ideas?
If you need the project to have a look at it, tell me so.
Thank you in advance for your time,
SM
|
|
|
|
|
Hello world..... Well close enough....
Well my problem is that I can't figure out how to take a piece of a bitmap (stored in a picturebox... or whereever), and copy this to another picturebox, or event better: Directly to the screen.
also I would like to be able to flip this image....
Hope you can / will help
>
|
|
|
|
|
|
Hi, perhaps someone can help me...
I run a query like this:
string str = "SELECT LOG.Type, LOG.Time, LOG.Nick, LOG.Message FROM LOG WHERE (((LOG.Type) Like 'SAY') OR ((LOG.Type) Like 'ACTION') ) AND ((LOG.Message) Like '*text*') ORDER BY LOG.Time DESC";
OleDbDataAdapter sda = new OleDbDataAdapter(str, accessConn);
sda.Fill(dt);
DataRow[] rows = dt.Select();
For simplicity, str equals the string i copied from a stringbuilder object while debugging. The Message field is of memo type. dt is a DataTable object.
Now the problems is, rows.Length = 0 after last statement, while sending the exact query via Access produces the correct results.
After some more debugging, it seems the problem is with the wildcards at Message Like '*text*' . Changing the query to Message Like 'text' produces the correct results.
Can anyone try this or help
|
|
|
|
|
OK i sorted this, maybe a bug
Resolution:
converted access db to access 2002 format and made db ANSI-92 complaint.
i then search using ANSI-92 standards IOW % instead of * for wildcard.
|
|
|
|
|
|
From MSDN:
Initializes a new instance of the String class to the value indicated by a specified pointer to an array of 8-bit signed integers, a starting character position within that array, a length, and an Encoding object. This constructor is not CLS-compliant.
[C#] unsafe public String(sbyte*, int, int, Encoding);
I assume this is what you need.
Read MSDN
|
|
|
|
|
I have a DLL which was made in Delphi 6.0
Its source code looks like this:
===========================================
library TestDLL;
uses
SysUtils,
Classes,
Windows;
procedure GetInteger(var N : integer);
begin
N:= 115;
end;
exports
GetInteger;
begin
end.
======================================
As i thought this function after calling it in C# by:
======================================
[DllImport ("C:/MyTest.dll")]
static unsafe extern void GetInteger(int* i);
int N = 0;
GetInteger(&N);
Console.WriteLine("N value after calling GetInteger: " + N);
=========================================
Have to write string "N value after calling GetInteger: 115" in console, but i saw "N value after calling GetInteger: 0"...
So my anser is: where is my mistake?
|
|
|
|
|
koenig wrote:
[DllImport ("C:/MyTest.dll")]
static unsafe extern void GetInteger(int* i);
int N = 0;
GetInteger(&N);
change to:
[DllImport ("C:/MyTest.dll")]
static unsafe extern void GetInteger(ref int i);
int N = 0;
GetInteger( ref N);
|
|
|
|
|
Not work properly
|
|
|
|
|
ok, try adding dll to working dir of application or anywhere in your PATH, then reference the dll like "MyTest.dll" , if that doesnt work, then i guess the dll is at fault.
You can mail it to me if u want to.
|
|
|
|
|
Problem was in DLL.
I changed procedure in Delphi, and now everything ok =)
procedure GetInteger(var N : integer); stdcall; //!!!!!!
//stdcall converts integer to MS format for integer
begin
N:= 115;
end;
Thanx for help...
|
|
|
|
|
Try using a different CallingConvention in your DLL import. Its likely that a Delphi DLL won't be the default MS convention.
|
|
|
|
|
>> Delphi DLL won't be the default MS convention.
Yes, it's realy so...
I solved a problem by changing function in Delphi.
|
|
|
|
|
Well this may be a stupid question, and some of you may laugh.... eventhough here goes: How the H..., do you move a form using C#???
//NJ
|
|
|
|
|
|
Thanks..... actually I just found out another way.... I will still try your's....
|
|
|
|