|
|
|
Hi everyone,
I come mainly from a C++ background. However, I am very interesting in learning C#. I am particularly interested in developing my own GUI controls (seems easier to do it than C++). I am also proficient in Java. Can somebody point me to some tutorials or code samples that can help me? Codes for control subclassing or creating controls and registering them with the designer and stuff would be great!
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Codeproject has quite a big selection of articles and tutorials that should get u going in no time
Just look under the C# section.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
im interested too, in fact, i started making one about 4 days ago, its a good way to learn [i think] because if forces you to exlplor features.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
|
Hi, did a quick search on MSDN, not sure if this is what you are looking for but mite help .
Graphics.MeasureString Method
Graphics Class | Graphics Members | System.Drawing Namespace
Measures the specified string when drawn with the specified Font object.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
Say we have a list box and we have items. Now some of the items have long text, so that the entire text won't fit in [means we only see the left most portion that fully fits into the box].
Now we can show tool-tips and solve this issue. But what if I don't wanna show tool tips for those items that have text short enough to fit in the width of the listbox?
How do I determine whether a given string will fully fit into the listbox?
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I have a question about OnMouseHover and OnMouseMove! They seem to be called together
For example I assume OnMouseHover gets called when the mouse stays at a point for some amt of time. But I find that it is called along with OnMouseMove
Can someone who has experiences some similar stuff care to explain this to me?
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
My findings:
1. MouseHover only gets called if control has focus.
2. MouseMove gets called regardless.
3. MouseMove gets called when mouse is clicked or control receives focus.
4. MouseHover gets called when mouse hasnt moved for an interval (time???).
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
|
|
|
Getting value from stuff you don't own is a compelling
idea. Just think, someone else has created something
that has value, and has made it available to you. You
can now leverage its value in ways that makes all
parties richer. That's the promise of web services.
You need to know about web services. The advent of
standards-based web services marks a new era of
system development. First mainframe, then client-server,
the Web, now web services makes it possible to leverage
every legacy system of the past and do so much more
with your information assets.
Architag Press, a division of Architag International
Corporation, announces the publication of Web Services
Implementation Guide, Volume 1: Getting Started, by
Brian E. Travis and Mae Ozkan.
Sample chapters of the book is available at
http://www.architag.com/press/wsig.
This book will show you what a web service is, and
how you can align your internal systems and external
trading partner interactions to take advantage of this
new concept in system integration.
You will learn about the "Three Steps to Web Services":
* Automate internal systems
* Determine integration points
* Expose integration points as web services
This book is for systems architects, developers,
and I.T. decision makers.
Highlights in this book:
* Written in a light, entertaining style.
* Emphasis on architectural design for web services.
* A tutorial on the state of web services standards.
* Plenty of real-life examples of web service use.
* Tutorials on the key technologies: XML, SOAP,
WSDL and UDDI.
* Code samples of key XML-based web services
technologies and extensions.
* Companion Web site with all code samples and
late-breaking information.
----
Download sample chapters of Web Services Implementation
Guide at http://www.architag.com/press/wsig/.
Stanford Powers, Publisher Architag International Corp
Phone: 866-898-0001 Outside US: +1-303-426-3126
Email: spowers@architag.com Fax: 720-294-1396
|
|
|
|
|
How do I set the IsDefault property to True so that the Button is the default button of the form?
the IsDefault is a protected property, and its inheritted from ButtonBase.. so you can't set it to True
any ideas?
thanks
~Dan
--------------------
If anyone else doesnt know, the property to use is the AcceptButton of the form.
ex: this.AcceptButton = button1;
|
|
|
|
|
It's actually a property of the form now - AcceptButton and CancelButton. IsDefault is readonly and returns true if this button is the forms .AcceptButton. These can be set through the form designer or code.
|
|
|
|
|
I'm working on a c# application and i'd like to get it launchable from Microsoft Word using a new icon. The problem is I don't know how to do, I've been searching throw articles but they often explain how to launch and control Word from an application and not the contrary.
Could someone explain me how to do such a thing, or at least give me a few steps ?
Thank you.
---------
Or not ?
|
|
|
|
|
Can everyone explain me the following lines?
<br />
GCHandle handle = GCHandle.Alloc( savedArray, GCHandleType.Pinned );<br />
int scan0 = (int) handle.AddrOfPinnedObject();<br />
scan0 += (h - 1) * stride;<br />
Bitmap b = new Bitmap( w, h, -stride, PixelFormat.Format24bppRgb, (IntPtr) scan0 );<br />
handle.Free();<br />
What does the GCHandle object? Can I use the "fixed" keyword instead, to get the adress of "savedArry"?
|
|
|
|
|
Can you tell me where the code comes from, and what it's trying to do?
|
|
|
|
|
The code comes from the "SampleGrabberNET" sample on http://www.codeproject.com/useritems/directshownet.asp.
The code should save a memory-image with the Bitmap object.
|
|
|
|
|
I think you should be able to rewrite this as:
Bitmap b;
fixed (byte* pByte = savedArray)
{
IntPtr bits = new IntPtr(pByte + (h - 1) * stride);
b = new Bitmap( w, h, -stride, PixelFormat.Format24bppRgb, bits );
}
If you knew the size of the bitmap, you could also create a new one that size, use LockBitmap to get to the bits, and just copy the memory across.
|
|
|
|
|
I am writing a class that overrides Control and utilizes the non-client area. I need to be able to have hotspots within the non-client area. However, because of what seems to me to be unusual behavior, I am not able to get it working.
I override WndProc to intercept WM_NCMOUSEMOVE and WM_NCPAINT (as well as WM_NCCALCSIZE, WM_NCHITTEST, and WM_LBUTTONDOWN/UP) as follows:
(Please don't flame me for posting VB.NET code. I use both interchangably as they are pretty much the same thing anyways. It just so happens that I wrote this in VB.NET. I posted here because I would guess that C# programmers know more about the Win32 API than VB.NET programmers, and my questions have nothing to do with VB.NET)
Protected Overrides Sub WndProc(ByRef msg As Message)
Select Case msg.Msg
Case 131 'WM_NCCALCSIZE
...
Case 132 'WM_NCHITTEST
...
Case 133 'WM_NCPAINT
Dim dc As Integer
dc = GetDCEx(msg.HWnd.ToInt32(), msg.WParam.ToInt32(), 65536 + 128 + 1)
Dim hdc As IntPtr = New IntPtr(dc)
Dim g As Graphics = Graphics.FromHdc(hdc)
OnPaintNonClient(New PaintEventArgs(g, Rectangle.Round(g.ClipBounds)))
ReleaseDC(msg.HWnd.ToInt32(), hdc.ToInt32())
Case 160 'WM_NCMOUSEMOVE
Dim pt As PointL
pt.x = msg.LParam.ToInt32() Mod 65536
pt.y = msg.LParam.ToInt32() / 65536
Dim ppt As IntPtr = Marshal.AllocHGlobal(8)
Marshal.StructureToPtr(pt, ppt, False)
ScreenToClient(msg.HWnd.ToInt32(), ppt.ToInt32())
pt = Marshal.PtrToStructure(ppt, GetType(PointL))
Dim args As MouseEventArgs = New MouseEventArgs(MouseButtons.None, 0, pt.x, pt.y, 0)
OnNonClientMouseMove(args)
Marshal.FreeHGlobal(ppt)
Case 161 'WM_NCLBUTTONDOWN
...
Case 162 'WM_NCLBUTTONUP
...
Case Else
MyBase.WndProc(msg)
End Select
End Sub
Protected Overridable Sub OnNonClientMouseMove(ByVal args As MouseEventArgs)
If ... Then 'Test hotspots
...
PostMessage(Me.Handle, 133, 0, 0) 'WM_NCPAINT
End If
End Sub
Protected Overridable Sub OnPaintNonClient(ByVal args As PaintEventArgs)
...
End Sub
There are no problems painting the non-client area for resizes, max/min, etc. Intercepting WM_NCMOUSEMOVE and testing for mouse-overs on my hotspots works fine. However, the weird thing is that when my code does the PostMessage call, the WM_NCPAINT message never reaches WndProc .
Does anyone know what is going on?
Does Windows.Forms not send every message on to WndProc ?
Do I have to do something with PreProcessMessage ?
Can what I am trying to do actually be done in Windows.Forms?
Thanks.
|
|
|
|