|
Hey all,
I am new to using C#'s windows.form so sorry if this seems too trivial.
I need to create a control ("LineControl") that draws a line with the two ends of the line bound to two other controls called "LinkerControl". If the LinkerControl at the end of the line is moved, the LineControl is automatically updated and redrawn to keep the LinkerControls linked. Can anyone help me with this? Thanks a lot!!!
Tom
|
|
|
|
|
Hi!
Your LineControl will have to have two properties to hold references to the 2 connected LinkerControl s. When one of these properties is set, you could add an event handler for a Moved or PositionChanged event your LinkerControl s provide (don't forget to remove previously attached event handlers, if any).
In this event handler you correct the position of your endpoint and Invalidate() your LineControl to let it redraw itself.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thx Mav for your reply. However, i am having trouble with the drawing part that links the LinkerControls together. How can i create an object draw a line that can be delete, repaint automatically when i restore the Form after minimizations, etc. I have read:
http://www.codeproject.com/csharp/drawingshape.asp
However, the drawing is global (I can draw onto outside of the Form's clientRectangle) and since its graphics, it is erased once a new object is over it.
I hope this clarifies my objective. Thanks!!
Tom
|
|
|
|
|
Anybody out there know where I could go to lookup the process used for contacting AD via the DirectorySearcher object?
What I am specifically looking for is what is used to send user password info across the wire.
I am trying to create a connection with a Winform app. My concern is if someone other than the logged on account tries to access AD he/she has to enter a password, which means that either the DirecorySearcher either changes the user info into a token for transport, encrypts it to the standard AD format for comparison against the AD db, or it sends it unencrypted where it gets encrypted at the server and then compared...
I've watched the net traffic of the DirectorySearcher and don't see anything (user info) in plain text, but didn't spend too much time trying to find it either. However I did see all the returned data from AD was ALL in plaintext, which is why i'm concerned about the securtiy of the user info.
Any info, links, or wisdom shared is much appreciated.
thankz,
string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";
Why is common sense such an un-common comodity?
|
|
|
|
|
Hi,
I am working on an installer application to install 2 COM components in the system32 directory. I had this implemented previously to install to a different directory (i.e. C:\sample\dll) and it worked fine. The setup app seems to crash though when I changed the path to C:\windows\system32. This is the error I receive...
System.Runtime.InteropServices.COMException (0x80110401) Errors occurred accessing one or more objects
I am guessing its a configuration problem?
Any help would be appreciated.
Thanks!
|
|
|
|
|
Hello.
I will try to explain better my problem.
I have one application 3-tier.
In Data tier i have a class Address(example).
In Business tier (exposed by webservices) I have two webservices that returns class Address.
In Client or Interface Tier i have one module aspx that makes management of addresses. But in this class i only can import Webservice1.Address or Webservice2.address. But i want import only class Address, and not webservice1.address and webservice2.address (in client this 2 address classes are not the same).
I could i do that.
Thank you.
António Dias
Thank you,
António Dias
António Dias
-- modified at 5:21 Saturday 16th September, 2006
|
|
|
|
|
acardeiradias wrote: But, Address object are exposed diferently to client. The client see Webservice1.Address and Webservice2.Address.
Could you explain that in more detail.? I don't understand your problem and as it seems no one else does.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I modified my initial message and i hope that my question be more clear.
Someone could help.
|
|
|
|
|
I am getting a NaN on the right side of the following statement
costWithInsert = RowVectorOne[i] + m_InsertCost;
where
float[] RowVectorOne = new float[rows];
float costWithInsert;
float m_InsertCost;
The left side has regular values and the array is not out of bounds.
The strangest thing is that it happens completely randomly.
I would appreciate any help in locating the cause of this problem.
Thanks,
David
|
|
|
|
|
And how is this different from the same post you made about 20 minutes earlier?
only two letters away from being an asset
|
|
|
|
|
davidmakovoz wrote: I am getting a NaN on the right side of the following statement
costWithInsert = RowVectorOne[i] + m_InsertCost;
davidmakovoz wrote: The left side has regular values and the array is not out of bounds.
I suggest after mastering left and right, you only then move on to vectors...
|
|
|
|
|
Hello,
I have a form: Form1 that launches a bunch of modeless forms:
formTemp.Show()
When I am closing my Form1, I want to know if there are formTemps are still open.
How can I find that out?
Thank you.
|
|
|
|
|
Add your forms to the parent using the AddOwnedForms method or by setting the owner property of the child form. When the parent is closed, all of the child should also close.
only two letters away from being an asset
|
|
|
|
|
I did that.
tempForm.Show(this)
However, just because one of the forms is an MDIParent, it must be a TopLevel Control, so it's always on top of the main form Form1, and I don't want that. That's why if you don't set the owner property everything works the way I want, but then I can't use OwnedForms property on the Form1 anymore. Is there a way around it?
Thank you
|
|
|
|
|
Then you're left with maintaining a collection of the created forms on your own. Not a difficult leap.
only two letters away from being an asset
|
|
|
|
|
I guess that would be a good approach. Thank you.
|
|
|
|
|
Have you ever tried Google Notebook? After installing the software, it will add a button at the bottom-right corner of IE. Dose anybody know how to implement that ? Any reply is appreciated.
Thanks
R.Y.J
|
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
i am trying to extract data from a file in c#.For this i match string "From" in the file .
if matched found the offset is calculated.
problem is this that for two matched string offset in calculated accurately.But for further offset is not accurate
althogh matched is found but offset is comes less that the actual string position
i write the code here it might be possible that function is not suitable
uint pos=m_dwStartPosition+4;
int eof=SRfin.Read(MatchString,0,4);
while(eof!=0)
{
MatchedString=new string(MatchString);
if(MatchedString=="From")
{
//that is problem
MessageBox.Show((m_startposition+pos).ToString());
}
pos+=1;
eof=SRfin.Read(single,0,1);
for (int i=0;i<3;i++)
MatchString[i]=MatchString[i+1];
MatchString[3]=single[0];
}
}
Parshant
|
|
|
|
|
In what way is the result not accurate? What do get, and how does that differ from what you expect?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I get an erratic behavior in my C# program.
The following statement
costWithDelete = RowVectorTwo[i - 1] + m_DeleteCost;
once in a while produces NaN on the right side with complete valid right side value.
The strangest thing is that it seems to be hapenning completely random.
My first suspicion was that I am messing up the memory somewhere,
but from what I know about C# (which is not much) is that
it does array bounds checking pretty thouroughly
Thanks,
David
|
|
|
|
|
There is nothing wrong with the code that you have shown, so the problem is in code that you haven't shown.
---
b { font-weight: normal; }
|
|
|
|
|
I know that much.
The problem is that this line is a piece of a fairly big project.
I have been trying to simplify it to locate the cause
but so far unsuccesfully.
In my experience this kind of problem is caused
by the memory being messed up.
And it can be done by any part of the program
seemingly unrelated to the one where the NaN shows up.
I wonder if there is a way in VS debugger to set up
memory access checking. I know such functionality
exists in Sun's debugger "workshop".
Also I was under the impression that C# does
very rigorous array bounds checking and such
would ocurr the whole program would crash.
|
|
|
|
|
It's not very common that the memory gets messed up nowadays. As you mention, C# does bounds checking, and you can't access memory outside a variable or array unless you use pointers in an unsafe code block.
A NaN value is represented by a bit value that starts with 7FF? or FFF?, so it's not very likely that some random data would produce a NaN value, it's much more likely that it would produce some other garbage value.
It's possible that you have some memory corruption, but I think that it's much more likely that there is some other bug in the code.
---
b { font-weight: normal; }
|
|
|
|