|
Hello,
I have created a TreeView that works fine apart from I can't work on how to get rid of the plus sign and line on the root node.
Does anyone know how to do this? Perhaps it isn't possible?
Thanks,
Matt
Matt Daley
Imutome Limited
Bristol, United Kingdom
matt.daley@imutome.com
|
|
|
|
|
I think you want to set the TreeView's ShowRootLines property to false . Untested suggestion.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Opps, Sorry, I forgot to mention that this is a WebControl TreeView, not the Web Form one. The Web Form TreeView has a ShowRootLines property but the WebControl one doesn't.
Matt
Matt Daley
Imutome Limited
Bristol, United Kingdom
matt.daley@imutome.com
|
|
|
|
|
Hello,
I'm wondering, what should I read about if I want to make a bandwidth monitor? And for just making sure what I mean with a bandwidth monitor I mean I want to show how much a user has downloaded and uploaded and how much (fast) he/she is uploading download at the current time =)
Any links? Articles?
I don't need articles specific for making a bandwidth monitor just subjects that when I know them I will proberbly be able to do a bandwidth monitor.
Thanks in advance dear code project members! =)
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
Yes, I have one here on CP i did ages back, still using it everyday. Search for MyDUMeter.
|
|
|
|
|
Thanks, I'll look into that! =) Do you have any topics that will learn me how to do it myself? I know I can look at your code and try to understand but I would like some article where they explain how things work =)
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
|
argh! =P what about some articles? =)
|
|
|
|
|
My project form are added dynamic,How are to load these forms by form name , like this.
Form f = new Form(“FormName”);
Thank you
|
|
|
|
|
Hi Richard. This almost looks like MS Access Basic syntax . In C#, forms are objects just like everything else, and are instantiated with their class name. If I have a form called "DocForm" in my project, I could add an instance of this form at runtime with the following:
DocForm f = new DocForm();
f.Show() Was this what you meant?
|
|
|
|
|
You can use reflection. A primitive implementation would be like this:
Type t = Type.GetType("FormName");<br />
Form f = (Form) Activator.CreateInstance(t);
That of course depends on what you mean with "forms are added dynamically", if the specified type is in the same assembly where the above code is executing, it should work.
|
|
|
|
|
Thank both of you!
The second answer is What I wanted,I have test it works.
Following is my test code
///---------------------------------------------------------------------------
private void button1_Click(object sender, System.EventArgs e)
{
Module[] moduleArray;
moduleArray = Assembly.GetExecutingAssembly().GetModules(false);
//In a simple project with only one module, the module at index
// 0 will be the module containing these classes.
Module myModule = moduleArray[0];
Type myType;
myType = myModule.GetType("WindowsApplication1.Form2");
Form f = (Form) Activator.CreateInstance(myType);
f.Show();
}
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
|
|
|
|
|
Hi Richard. I think I misunderstood what you were looking to do. I'm glad you got the information you needed from Baris' post.
|
|
|
|
|
DateTime dt = DateTime.Now
gives me american date and not the british format d/m/y
i need the d/m/y
please
|
|
|
|
|
Internal representation of the DateTime object is not culture specific. It's the way you format it in ToString method.
DateTime.Now.ToString("dd/MM/yyyy");
note the capital MM if you put mm you will get minutes not the current month.
|
|
|
|
|
fantastic, i also noted in control panel (XP) a setting with American Language but I never knew about the ToString parameter very useful
|
|
|
|
|
This is also useful when using String.Format or Console.WriteLine . See the DateTimeFormatInfo documentation for more information, as well as my article, Custom String Formatting in .NET[^] for much more information, as well as links to other resources in the .NET Framework SDK.
Formatting strings properly in .NET is good to know.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
did you see my code about the error today a copy of my Tabpage class wonder if you have any thoughts
|
|
|
|
|
Also, read the docs for the CultureInfo class. If you need to convert dates and times from one culture to another, you can use the current CultureInfo as well as a specified culture and use their Calendar property to help convert. Also, if you are creating international applications, it's better to use DateTime.UtcNow to get the coordinated universal time.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Is there a way to get the scrollinfo of the TreeView?
I have tried PInvoke but doens't seem to work. Anyone sheds the light?
below are my codes
using System.Runtime.InteropServices;
public struct SCROLLINFO
{
uint cbSize;
uint fMask;
int nMin;
int nMax;
uint nPage;
int nPos;
int nTrackPos;
}
[DllImport("user32")] public static extern int GetScrollInfo(IntPtr hwnd, int n, ref SCROLLINFO lpScrollInfo);
//calling part
const int SB_VERT = 1;
SCROLLINFO si = new SCROLLINFO();
GetScrollInfo(this.tvStat.Handle, SB_VERT, ref si);
//the si return is all zeros. Doesn't work apparently
thanx
<B>Sonork 100.41263:Anthony_Yio
Life is about experiencing ... </B>
|
|
|
|
|
Before calling GetScrollInfo you must set the cbSize and fMask fields of the structure, which is also documented for the GetScrollInfo API and is common among many APIs that take structs as params so that they know the size of the struct, which makes the API more robust.
To do this, use the static Marshal.SizeOf method from the System.Runtime.InteropServices namespace.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I see, will try that, thanks.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
As per the subject, does anyone have even the faintest idea, using C#, of how I make a thumbnail screenshot of a webpage programatically? There are one or two ActiveX components out there that do this, and they render it exactly as IE would, which leads me to believe that it's some kind of functionality in IE. Perhaps it's somehow loading the website into an invisible browser window and taking a screenshot that way? I need to work this out for at least two or three tasks I'd like to implement solutions for. Please note that this has to be able to be completely automatic and doable from nothing more than a given URL.
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|
|
|
Thanks Mike, looks like it could exactly what I'm after!
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|