|
ARG! I was so proud of finding that :P
Oh well, to bad.
Just the Form border thing to figure out now. Is there any Control that represents a forms border?
(hmmm... cheese...)
|
|
|
|
|
A form border is not a control, it's just colored pixels (i.e., painted). Use the ControlPaint like I mentioned earlier and handle the mouse events appropriately. That's all window managers like Windows basically do. Everything currently comes down to painting a 2D image into a device context and handling various events when the cursor is in a certain position.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Ok, can do all the moving and re-shaping. I've created a set of panels around the edge of the control that can be used to re-size or move it.
But i really need the final touches.
Where can i find the windows graphics for top, bottom, and sides of a window to insert into the bordering panels? I was looking at the ShellStyle.dll. Am I going the long winded way around?
|
|
|
|
|
Hi!
Does anyone knows if there's an object to handle events, like the Api's functions CreateEvent() or SetEvent().
I need to set events to check some objects state, and using WaitForSingleObject() to wait for the event. In C++ I would do:
SetEvent(hEvent1);
dwerror=WaitForSingleObject(hEvent2, timeout);
ResetEvent(hEvent1);
How could I do something like that in C#?.
Thank you.
Demian.
|
|
|
|
|
You could start by searching Code Project. Here you will find a number of articles on Event Handling. Here is a promising looking article:
http://www.codeproject.com/csharp/csevents01.asp[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
Some more information on events from the Microsoft web site: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriEventHandlers.asp[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
See the System.Threading namespace as well. There's a lot of objects that can be signaled, like those deriving from WaitHandle . These classes and their members actually use the native APIs like WaitForSingleObject and encapsulate them in easy-to-use classes.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am trying to create a class iheriting from Hashtable. My aim is, it has to save (serialize) itself when a key/value pair is assigned to it. Also, it has to deserialize in the constructor.
I could make it work by haing the Hashtable as a member of my class, it couldn't do it when I tried to inherit my class from hashtable. Can any one help?
TOJO
|
|
|
|
|
It won't work when you deserialze (by default) since a new object is created from deserialization. What you probably could do is deserialize to a new object (a your Hashtable derivative) then enumerate through the DictionaryEntry objects (using the IDictionaryEnumerator from Hashtable.GetEnumerator ) and add them back into your current instance. When the deserialized Hashtable falls out of scope, it will eventually be garbage collected.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi, thanks for reading my post.
I am trying to produce a custom control based on a textbox. This is to be distiguished from a regular text box by a small red triangle at the bottom right of the control.
I have managed to get the triangle to display correctly.
My problem is that when I enter text, it displays correctly but when the delete key is pressed, it does not remove the characters, it just moves the cursor back one space.
I have tried Invalidating the control every time a key is pressed (and in a few other events) but when this is done, the keypresses are registered (the cursor moves) but the text is not displayed.
I have even tried to make my event handler draw the text but that has given me a whole raft of other problems and I don't think that the background event should be drawing the foreground anyway.
The code for my OnPaintBackground event is as follows:
<br />
protected override void OnPaintBackground(PaintEventArgs pevent)<br />
{<br />
base.OnPaintBackground (pevent);<br />
<br />
Rectangle r = pevent.ClipRectangle;<br />
PointF[] pts = new PointF[3];<br />
<br />
int sideLength = 5;<br />
<br />
pts[0] = new PointF(r.Right, r.Bottom - sideLength);<br />
pts[1] = new PointF(r.Right - sideLength, r.Bottom);<br />
pts[2] = new PointF(r.Right, r.Bottom);<br />
<br />
pevent.Graphics.FillPolygon(Brushes.Red, pts);<br />
}<br />
Please help point me in the right direction (or if you prefer, you could always give me a finished example )
Thanks in advance
Stephen
|
|
|
|
|
DataSet ds = new DataSet();
ds.ReadXml(filePath);
dataGrid1.DataSource = ds;
dataGrid1.DataMember = "database";
dataGrid2.DataMember = "package";
Now dataGrid1 is on tabPage1 and dataGrid2 on tabPage2. He fills dataGrid1 correctly but how can i fill tabPage2? Because he doesn't do it like this.
thx in advance
|
|
|
|
|
bertcox wrote:
Now dataGrid1 is on tabPage1 and dataGrid2 on tabPage2. He fills dataGrid1 correctly but how can i fill tabPage2? Because he doesn't do it like this.
Uhhhh....You didn't supply near enough information to answer this. What is stopping you from filling dataGrid2?
RageInTheMachine9532
|
|
|
|
|
sorry! incredibly stupid mistake
i thought i already filled dataGrid2
thx
|
|
|
|
|
Does anyone know how to move
a row (in DataTable or DataSet or DataGrid)
I mean: for example
present fourth row as a fifth
and fifth as a fourth
doesn't work!?
DataSet ds = (DataSet)dataGrid1.DataSource;
ds.Tables[0].Rows.InsertAt(dr,i);
|
|
|
|
|
Do some free class libraries for long numbers computition exist? And where I can find one?
Jast a student!
|
|
|
|
|
Lego Bragis wrote:
Do some free class libraries for long numbers computition exist
Your question is a bit too vague to answer. What are you looking for in the way of computations? And what do you mean by 'long numbers'?
RageInTheMachine9532
|
|
|
|
|
First of all, I am sorry for my English.
I mean that i need library for working with sach big numbers, that they can be represented with no simple types (int, long, etc.).
Jast a student!
|
|
|
|
|
Have you looked into the Double type?
From the VS Docs:
The Double value type represents a double-precision 64-bit number with values ranging from negative 1.79769313486232 e 308 to positive 1.79769313486232 e 308, as well as positive or negative zero, PositiveInfinity, NegativeInfinity, and Not-a-Number (NaN).<br />
<br />
Double complies with the IEC 60559:1989 (IEEE 754) standard for binary floating-point arithmetic.
There is also a LargeNumber class here on CP at http://www.thecodeproject.com/cpp/largenumber.asp[^].
You might also want to Google for 'Large Number Class'. You'll find a project on SourceForge.net.
RageInTheMachine9532
|
|
|
|
|
'Large Number Class' is almost what I need. But actually I need .Net class. I think I found it here : http://www.codeproject.com/csharp/BigInteger.asp?print=true
Thank you. Google - RULEZZZZZ!
Jast a student!
|
|
|
|
|
Math class should be sufficient shouldnt it!
your can use 64bit ints aswell!
|
|
|
|
|
Hello. How can I use Internet Explorer DOM from C# program?
Jast a student!
|
|
|
|
|
You can add the IE COM component to your project. Go to the Toolbox and right-click in it. Select 'Add/Remove items...', then click on the 'COM' tab. Find the 'Microsoft Web Browser' (shdocvw.dll) and make sure the checkbox next to it is selected. Click OK to add the Browser component to the Toolbox. Then go back to the Tookbox and drag the component onto your form.
RageInTheMachine9532
|
|
|
|
|
What Dave said will only add the AxWebBrowser control, which is defined in the AxInterop.SHDocVw.dll assembly. Additionally, a Interop.SHDocVw.dll assembly is created that contains the delegates and interfaces needed to interface with it. If you want to actually traverse and interface with the DOM, you need to add a reference to the Microsoft.mshtml.dll assembly (probably in your GAC, but should be on your system when you install VS.NET et. al.).
Then, to get an instance of the IHTMLDocument2 interface, cast axWebBrowser1.Document to IHTMLDocument2 . In .NET, casting COM-defined interfaces is the same as QI'ing (QueryInterface ) for them like you would in COM. If you get a null reference, it means the interface is not supported.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Ahh. Thanks Heath!
RageInTheMachine9532
|
|
|
|
|
Hi there!
I wrote an application which calls several methods of a WebService. But how can i set the URL where the WebService is located AFTER compiling my application?
Thanks for reading
|
|
|
|