|
Thanks for the reply, but i wanted slightly different result which i achieved using DictionaryEntry object.
|
|
|
|
|
I am having treeview with some nodes. If there is no. of node is more than height of treeview then scroll bar is coming.
Now the problem is, because of scroll bar i am not able to see the last node. How i can solve this issue?
Thanks in advance.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:49am.
|
|
|
|
|
Scroll bar is required, because there are nodes which is greater the height of TreeView. It should show the last node even scroll bar is there. Am i missing any porperty or Is it microsoft fault.
|
|
|
|
|
Can you post some example code that demonstrates this? Does it always not display the last node when there is a scroll bar, or is it only if there are a certain minimum number of nodes? Are you using Windows Forms or ASP.net? Can you post a screenshot somewhere and add a link to it from here?
I've encountered your issue when adding a bunch of nodes (32,000 or something like that) to a TreeView. There is no way around it that I know of. However, you could put any nodes that would make the TreeView have more than 32,000 nodes into a new TreeView instead... or implement TreeView paging. Or you could allow the user to filter the nodes somehow (if they are alphabetic in nature, you could allow them to show only a letter at a time, for example).
You could also disable scrolling on the TreeView itself, but enable scrolling for the container that holds the TreeView. And if you still have the issue, put a control (e.g., a label) at the bottom of the TreeView so that that control gets hidden instead of part of the TreeView.
I can assist you further if you provide more information.
|
|
|
|
|
Thanks for alternative solution. Actually i am using Windows Forms and this problem is also there when scroll bar comes in to picture. Now i am adding one extra node at the last of treeview, so that this extra node will going to be hidden.
|
|
|
|
|
After adding extra node at the last, we can select last node by key down arrow.
How we can disable any particular TreeNode, not complete TreeView in windows form.
|
|
|
|
|
This happens in windows forms with only a few nodes. Doesn't have to be 32,000 nodes! THe only work around that I've found is adding a blank node to the end as mentioned elsewhere on this thread.
-Dax
|
|
|
|
|
I found that adding this line to the forms load event (or where you set the items in the treeview) helps:
this.treeView.Height = (this.treeView.Height / this.treeView.ItemHeight) * this.treeView.ItemHeight + 3;
I'm in the high-fidelity first class traveling set.
And I think I need a Lear jet.
|
|
|
|
|
Thank you all for your responses. Although my question per se was not answered you all responded with reasons as to why it was basically unanswerable.
Iknow..."there aint no free lunch" so stay away from the freebies. However I did pay for Sams "Learn C# in 21 Days" and got essentially the same thing.
If anyone can suggest a good learning source I would greatly appreciate it.
I started programing in GW Basic in 1985 and progressed from there to QB45 and did well enough to produce some quite usable programs including a construction survey layout program which saw a lot of use.
That was in 1995 and I haven't done any programming since. I now want to learn and be able to program in C# but have obviously approached it from the wrong direction. If it wasn't for people like you I wouldn't have made it this far.
Again, thanks for all your responses.
|
|
|
|
|
Darrall, check out Wrox Press[^]. I've found them to be consistently excellent in all their programming texts. Right now I'm using Professional C# 2005 with .NET 3.0 as a reference while I'm trying to learn, and it's excellent, if a little dated. I should update it, but it can't have changed too much in just a couple of years.
By the way, as a tip from someone who throws away more books each year than most people read in ten years, any book with "... Essentials" or "... in 21 Days" in the title is crap. Just a rule of thumb, but I've never seen an exception.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
modified on Friday, January 29, 2010 12:28 AM
|
|
|
|
|
Roger Wright wrote: I've never seen an exception.
You must write top class code!
MVP 2010 - are they mad?
|
|
|
|
|
|
Thanks I'll check into that.
|
|
|
|
|
This is from a tutorial from Home & Learn:
http://www.homeandlearn.co.uk/csharp/csharp_s13p3.html[^]
The problem I am having is with an uninitialized variable but I can't figure out how to do it:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Multiple_Forms
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Form2 secondForm = new Form2();
public static TextBox tb = new TextBox();
private void btnFormTwo_Click(object sender, EventArgs e)
{
secondForm.ShowDialog();
}
private void Form1_Load(object sender, EventArgs e)
{
tb = txtChangeCase;
}
}
}
The problem is with the last line.
I can see why...just can't figure out what to do to fix it.
Anyone know the answer?
|
|
|
|
|
Why is tb static? What is txtChangeCase? And what is the exception? (I can only think of 1 case where a direct assignment to a field (not through an indexer or anything like that) could throw an exception: when there is an implicit cast that throws an exception (which is rare))
|
|
|
|
|
|
That tutorial fails on so many levels that I would advice against ever even thinking about it, but I'd like someone else's opinion about that too
I mean come on:
- a static textbox as a way to communicate between forms (please no.)
- creating a new textbox and then almost immediately afterward throwing it away without ever having used it (why?)
- writing ==true (seriously, wtf, you might as well write if((x == true) == true && x != false) just to be very sure that x is indeed true )
- referring to a computer program as "programme". huh? shows lack of knowledge of the jargon IMO, and I already got the impression that the writer of that tutorial is a noob (he also uses CreateGraphics inside the Paint event later on)
|
|
|
|
|
harold aptroot wrote: he also uses CreateGraphics inside the Paint event
he is to be shot on sight!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
I hadn't seen that site before, judging from that one page it isn't worth a penny, it being inaccurate and confusing.
Buy and study a book, you may learn all you need and more in less than a week. This[^] explains my view on books.
Trying to learn from a free site only gives you what you paid for, i.e. nothing much.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Luc Pattyn wrote: Trying to learn from a free site only gives you what you paid for, i.e. nothing much.
I don't know, I can think of at least one site that is free and is a pretty good learning resource. It may not compare to a book, but it is a little more than "nothing much".
|
|
|
|
|
that must be an exceptional site then.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Ditto the comments from the others.
Probably the most correct way to acheive the result that the tutorial was aiming for would be to:
1. Create a Case enum.
2. Have a private field of type Case in the dialog form that is set according to the radio buttons and expose this field in a public read only property.
3. Check the DialogResult of the dialog form in the main form, if OK then read the property before disposing of the form.
4. Use the Case obtained from the property in a switch block and change the TextBox 's Text property accordingly.
What is it you were wanting to learn from that tutorial - changing the case of a string, using a dialog to get a user selection that may be returned to the instanciating form, or general inter-object communication?
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thanks Dave. Basically the idea was to introduce using multiforms with the second form used to perform the changes on the first form. As you have all pointed out I am obviously using a poor source of information.
|
|
|
|
|
I'll knock you up a simple demo this weekend and post back here if that would be helpful. Colin Mackay has an article here[^] about passing data between forms. It's .NET 1.1 IIRC but the principles are still valid
In this situation, you only need the simpler Parent to Child relationship as that method can be used for both writing to and reading from properties. The Child to Parent is only needed when the Child needs to inform the parent when something has changed.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|