|
Okay... But also note that I'm not concerned with how a rectangle is drawn, just whether, in hyptothetical space, a point is in a rectangle or not.
If Bottom and Right are open limits by design, when are they actually used as such? I'd expect there would be a lot more code that does (this.Bottom - 1), but perhaps it's for lazy programmers who want to do (Bottom - Top), rather than (Bottom - Top + 1).
Either way, I'd argue that "Gets the y-coordinate of the bottom edge of this Rectangle structure" is inconsistent, especially since Top is described as "Gets the y-coordinate of the top edge of this Rectangle structure."
|
|
|
|
|
I can see why you might consider it to be inconsistent, but from a GDI point of view it is very consistant. The end point is a limit no matter what you are drawing using GDI, that even includes lines. I know from personal experence that this can be a pain when you want the end point included in the drawing area.
I do agree that the end point should be valid (/drawn). When I designed my own graphics library some years ago the end point was valid [it seemed the natural way to do it].
A bug is some thing that you did not intended to happen.
|
|
|
|
|
Check out "PocketPrep" from handango.com.
It has 90 questions based on the test spec. (070-316 and 070-306)
|
|
|
|
|
I am trying to run an access report in c#. The report runs ok but I cannot seem to stop the dialog box asking for the report parameter.
appAccess.DoCmd.OpenReport( reportName, Access.AcView.acViewPreview, "",
whereCondition, Access.AcWindowMode.acHidden, "");
The filtername and openargs (the "" fields) and the whereCondition parameters of the above method do not seem to set the report parameter.
How can I set a parameter value for this report?
It ain't what you know that matters.
Uncle Monkey
|
|
|
|
|
Hi,
I have a Form in which I want to capture input events (MouseMove , KeyDown ), before they propagate to the Controls of the Form. I tried overriding OnMouseMove , and not calling base.OnMouseMove , but this method seems to be bypassed when my mouse is over one of the controls of the Form. Do i have to set a flag somewhere to not automatically propagate the events to the child controls?
|
|
|
|
|
Is KeyPreview[^] what you're looking for?
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
When you assynchronously invoke a delegate using begin invoke, much to my dismay the AsyncCallback it calls when finished is called on the wrong thread.
The AsyncCallback is called on the same thread the assync processessing was done in. This is very annoying
What I need is for the main thread to be notified, so that from the callback method I can then call a method on the main thread.
Anyone figured out how you can do this ???
|
|
|
|
|
Go read this article. Even if you aren't working with a UI on the main thread, the techniques still apply.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Hi David,
Thanks for the link, it was very interesting.
However I still cant see how the parent thread can be called when you are not working with windows forms, for example if you are working in a console app.
I myself am specifically working with a class instantiated from the main form but not the main form itself.
I tried inheriting from Control but this didnt work.
What I need is the equivalent of Control.BeginInvoke but which can be used outside a form.
Is it impossible ?
|
|
|
|
|
I am using the TaskbarNotifier class to display incoming TCP/IP messages. I listen for a message on a port and when one is received, I start a thread that creates a new TaskbarNotifier object and shows the message. However, looking at Windows' Task Manager, I've noticed that the GDI Objects continue to grow (by 2 objects each time I am notified), even though the thread appears to end successfully (the thread count in task manager remains a constant 4).
If I call create TaskbarNotifier in the same thread as my TCP/IP listener, the resources don't grow, but the port is blocked until the notifier finishes.
Calling the thread without creading a TaskbarNotifier object also does not create growing resources.
Adding the single line:
TaskbarNotifier taskbarNotifier1 = new TaskbarNotifier();
to the thread class will cause the problem. If i set taskbarNotifier1 = null, it has no effect.
Any ideas welcome.
|
|
|
|
|
Howdy Folks!
Does anybody know of a way I can identify the current x,y location of the cursor in a Rich Text Box?
(Just for clarity - I'm talking about the text insertion cursor, not the mouse pointer...)
Thanks in advance!
Mojo.
|
|
|
|
|
you could do this :
VB:
<font color="blue">Private</font> void richTextBox1_MouseMove(<font color="blue">Object</font> sender,System.Windows.Forms.MouseEventArgs e)
{
<font color="blue">Try</font>
{
<font color="blue">Char</font> c=new <font color="blue">Char</font>();
System.Drawing.Point p=new System.Drawing.Point();
p.X=e.X;<font color="#006400">
p.Y=e.Y;<font color="#006400">
c=richTextBox1.GetCharFromPosition(p);
this.Text=(Convert.ToString(c));<font color="#006400">
}
<font color="blue">Catch</font>
{
System.Exception f=new System.Exception();<font color="#006400">
MessageBox.Show(f.Message.ToString());
}
}
hope that helps a little.
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
caret not cursor
<a TITLE="See my user info" href=http:
|
|
|
|
|
Try the GetCaretPos API function.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Thanks everyone for your help!
I eventually managed to do this using:
pt = rtf.PointToScreen(rtf.GetPositionFromCharIndex(rtf.Text.Length))
|
|
|
|
|
Dear all,
How to access a C# DLL function from a MFC app? Is it possible?
VikramS
|
|
|
|
|
Yes, compile your MFC application with /clr and use the #using directive for importing the C# DLL. You'll need to use Managed C++ for calling your C# DLL, but it's not a big deal.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
Hi all!
I have some problems with convert project from VB6 to C#.
I dont know how it be in C# code like this:
----------------------------
Public Event Wiadomosc(ByVal sender As Long, ByVal seq As Long, ByVal time As Long, ByVal class As Long, ByVal message As String)
----------------------------
Public Property Let ListaKontaktow(index As Integer, co As lbpoleKontaktu, value As Long)
If co = 0 Then
kontakty(index).nrgg = value
Else
kontakty(index).typ = value
End If
End Property
----------------------------
Public Property Get ListaKontaktow(index As Integer, co As lbpoleKontaktu) As Long
If co = 0 Then
ListaKontaktow = kontakty(index).nrgg
Else
ListaKontaktow = kontakty(index).typ
End If
End Property
----------------------------
Public Sub sendMsg(numerGG As Long, seq As Long, class As Long, msg As String)
Dim dlugosc As Long
dlugosc = Len(msg) + 12 + 1
sckGG.SendData 11&
sckGG.SendData dlugosc
sckGG.SendData numerGG //where sckGG is Winsock control i know that i must use Socket in C# but i don't know how
sckGG.SendData seq
sckGG.SendData class
sckGG.SendData msg & Chr(0)
End Sub
Greeting
S_W
|
|
|
|
|
|
Hi, friends ! If I want to create a window's control unit for reuse , how could I know when it should inheritance the Forms , Usercontrol , Control , Component ... ? what are they difference between them ? I am very confuse for them ? help me !! thx!
|
|
|
|
|
Hi, friends! How can I do a toolbar like VS.Net ? (it's called coolbar or rebar in C++), I have some library about that , but it's very complex for me , I want to know the keypoint , what is keypoint for coolbar in C# ? thx!
|
|
|
|
|
I am building a simple test application in c# that uses the Flash player ActiveX control to display some data.
I have two Classes in c#:
FooWindow.cs
Foo.cs
I then embed the Flash player in my app in visual studio.
When I compile everything, it creates the following files:
AxInterop.ShockwaveFlashObjects.dll
Interop.ShockwaveFlashObjects.dll
stdole.dll
Foo.dll
FooWindow.exe
This all works perfectly on my machine, but when I send it to other people to test, they get various errors. I am sending all of the files. Do I have to do anything special to distribute an app which uses an ActiveX control?
Thanks for any input...
mike c
|
|
|
|
|
When distributing C# apps, you have to make sure A) They have the .NET framework installed (only newest XP has it installed default), and B) Do they have the right version of .NET installed. I have found that 1.0 and 1.1 executables are not interchangeable (which is a bit dissapointing).
|
|
|
|
|
Do your testers have Flash installed on their machines?
|
|
|
|
|
Yes. Thus far, I have sent it to three people, and it didn't work for any of them.
They all have the same version of the flash player also.
mike c
|
|
|
|