|
I would like to display a set of dates in long format but want to keep all days months and years underneath each other with in a set of text boxes eg
01 January 2003
12 May 2005
14 December 2002
This is similar to how the datepicker works. If I use a space character the years do not line up as all space becomes compressed.
Any Ideas on the character I need to pad out the text with??
Thanks
Steve Graham
|
|
|
|
|
Not sure if this is possible, but try replacing the space character with a tab character, and then set the tab stops for the text boxes. This is the way I would do it with edit boxes or list boxes in MFC or Win32.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Is there any way to use the IActiveDesktop interface in c#? The only reason I want to do this, is to change the desktop wallpaper, but SystemParametersInfo only works with .bmp files. Is there some other way to do this?
|
|
|
|
|
How can I add an internet explorer type window to an application to display HTML.
|
|
|
|
|
|
emm..I hope this is what you are looking for.
If you are using VS .NET you can add a toolBox refferance to "Microsoft Web Browser" (swdocvw.dll)
The object can now be dragged and dropped onto a form.
And to navigate, assuming object is named axWebBrowser:
We have access to
axWebBrowser.Navigate("s_URL", ref, ref, ref, ref)
axWebBrowser.GoHome();
axWebBrowser.Refresh();
axWebBrowser.GoBack();
axWebBrowser.GoForward();
axWebBrowser.Stop();
etc
gadget
|
|
|
|
|
I am calling SetWindowLong inside my C# Windows Forms app and passing a valid hWnd and the other needed params.
The problem is its returning with error code 127, which the docs describe as:
127 The specified procedure could not be found. ERROR_PROC_NOT_FOUND
Why is this happening? As far as I can tell I've properly declared the function in my project as such:
[DllImport("user32", CharSet=CharSet.Auto)]
public static extern int SetWindowLong (IntPtr hWnd, int nIndex, long dwNewLong);
I don't have the same problem when I call GetWindowLong, only SetWindowLong.
This is pretty frustrating, any suggestions are welcome.
Thanks,
M.
|
|
|
|
|
I think it might be that the hWnd has become invalid, as the window handle has been 'recreated', during initialization, or after a change of certain properties. Is your code currently inside your main class constructor?, if so, try putting it in the form1_Load event.
|
|
|
|
|
That might be it.. I am actually doing this inside a WindowHook, after handling a hooktype of CBT_CREATEWND. I think that may mean that its before a WM_CREATE message has been posted for that window and thus the hWnd is not valid yet. Could that be it?
And that implies I am doing this too soon, and should be handing a different type of windows hook, that of WH_CALLWNDPROC.
Does that sound right?
|
|
|
|
|
DllImport("user32", CharSet=CharSet.Auto)]
public static extern int SetWindowLong (IntPtr hWnd, int nIndex, int dwNewLong);
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
I don't understand. The docs define it as taking a long as the 3rd parameter and returning a long, not ints in those cases. I must be missing something here?
|
|
|
|
|
MFC LONG is defined as a 32-bit integer, not a 64-bit integer as in the case of .NET long
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Hi,
I thought I saw an article on an implementation of an XP sytle App Crash Report util. That allows your app users to send in a report of a crash.
Anyone know if an article exsist like this.. I can't find it.
Thanks@
Amber Star
|
|
|
|
|
amberstar wrote:
Anyone know if an article exsist like this.. I can't find it.
SOrry I dont know of one, but have a look at Application.ThreadException. You can dig around in Reflector.NET as well, he uses such a system. Unfortunately no source. But that is what he uses.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
leppie wrote:
he uses such a system. Unfortunately no source. But that is what he uses.
Who is "he"?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Nick Parker wrote:
Who is "he"?
Lutz Roeder: http://www.aisto.com/roeder/dotnet/[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
|
David Stone wrote:
I update whenever he comes out with a new version.
In other words every week?
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Hi everyone,I'm a newbie of C# and I want to ask the meaning of the line in a sample code.
Here is the code,
namespace HashExample {
// A library contains a list of books.
class Library {
public Hashtable bookList;
public Library() {
bookList = new Hashtable();
}
}
// Books are placed in the library
class Book {
public Book( string t, int n) {
Title = t; ISBN = n;
}
public string Title;
public int ISBN;
}
class ClassMain {
static void Main(string[] args) {
Book b1 = new Book("Programming Microsoft Windows with C#", 0735613702 );
Book b2 = new Book("Inside C#", 0735612889 );
Library myReferences = new Library();
myReferences.bookList.Add(b1.ISBN, b1);
myReferences.bookList.Add(b2.ISBN, b2);
Book b = (Book) myReferences.bookList[0735612889];
Console.WriteLine( b.Title );
Console.WriteLine("\nPress Enter to quit");
Console.ReadLine();
}
}
}
I understood the hash tables.However this line doesn't make any sense on me
Book b = (Book) myReferences.bookList[0735612889];
What is the function of "(Book)" here?What does this mean?
Kind Regards,
-
kromozom
-
|
|
|
|
|
kromozom wrote:
What is the function of "(Book)" here?
Every Book is an Object, since by design in .NET all classes derive explicitly or implicitly from the Object class.
But not every Object is a Book, hence the need to cast.
That said, casting is mostly unsafe, and may produce an exception at run-time.
The best way to avoid casting is to either derive a specialization of HashTable (like the specialized string arrays derive from ArrayList), or use generics when it's supported (.NET 2.0 release).
|
|
|
|
|
Thanks for kind and fast reply .S.Rod.
I understood some parts of you have written in your reply. However there are some uncertain parts in my mind, could you give me more explanation about this or a web adress that I can find info about this.
I mean why --> Book b = (Book) myReferences.bookList[0735612889];
and what's wrong with this --> Book b = myReferences.bookList[0735612889];
Thanks again,
-
kromozom@msn.com for MSN messenger
-
|
|
|
|
|
When retrieving a value from a Hashtable you are given a System.Object as the return type, so it always needs to be cast to the Object type you need. A Hashtable works by boxing your values when added, and it's up to you to un-box them when retreiving them.
In your case you need to cast it to a Book object, however if it were string values in your Hashtable you would need to cast it to a System.String object, if it were double values you would need to cast it to double, and so on and so forth..
|
|
|
|
|
Thanks a lot Furty.
I understood this is because un-boxing and .Net wants to know which type we want to un-box it.
Thanks again.
-
kromozom
-
|
|
|
|
|
is it possible to get a "text" in a listbox from a mouse point.. im trying to make it so when the user hovers the mouse over a item in the list box that item becomes selected. Is it possible to do this ?
Thanks Alot.
Jesse M
The Code Project Is Your Friend...
|
|
|
|