|
I have tree view control.I overriden AfterSelect event.I want to get index of primary nodes,not sub nodes selected.I mean when I select oe of sub nodes I found out the index of its parent.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
I overriden AfterSelect event
Dont do that! Do this
protected override void OnAfterSelect(TreeViewEventArgs e)
{
base.OnAfterSelect(e);
}
This is the correct way of overriding event behaviour.
Now when you recieve the event it should work
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
Sorry,I can't understand! Could you tell how to define this function?
Thanks
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Just read MSDN, it explains it all. Specifically TreeView.OnAfterSelect Method[^]
Sorry, no web link
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
If I understand what you're trying to do, then every TreeNode has a Parent property that will return the Parent TreeNode for the current node or null if the current node is the root. You use this to find the immediate parent or iterate up the hierarchy until you find a node with Parent=null to find the root of the current branch.
|
|
|
|
|
Is it possible to have (by default) an OfficeXP/VS.NET visual style for Windows forms?
|
|
|
|
|
ZZZr wrote:
Is it possible to have (by default) an OfficeXP/VS.NET visual style for Windows forms?
Check the CP articles, the answer is there. CP is your friend.
|
|
|
|
|
Paul Watson wrote:
Check the CP articles, the answer is there.
These are Windows XP Visual Styles. That guy meant OfficeXP/VS.NET visual styles. Try http://www.dotnetmagic.com/[^]
Ñ There is only one MP Ð
|
|
|
|
|
Maciej Pirog wrote:
These are Windows XP Visual Styles. That guy meant OfficeXP/VS.NET visual styles
My apologies, thanks for the correction. Though as my 2 cents MS should really stick to one set of styles and make it available for all controls. Consistency!
|
|
|
|
|
Paul Watson wrote:
Though as my 2 cents MS should really stick to one set of styles and make it available for all controls.
I do agree.
Ñ There is only one MP Ð
|
|
|
|
|
Hey Paul, are you an editor again? I noticed the difference in your user icon. If so, congrats and what is the difference between say site builder/editor/supporter ?
CHeers
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
|
David Stone wrote:
I think this might be similar to what you wanted:
http://www.gotdotnet.com/team/changeinfo/default.aspx[^]
I did have look there previously, but it the site wont open now. It only really listed compatiblity issues.
David Stone wrote:
Oh, and they've changed their license stuff...
http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=40466 [^]
Yes I received a mail from them. The problem is as I understand, is that now private workspaces does not have that clause. I dont see the point. OK, maybe one step closer, but I still want share my code with others and allow them free use, not code for MS. The issue is actually much more complicated as my library is already bound to the license of the BASS library. Basically, by GPL'ing my library, I just let the user refer to BASS's license. So unless MS feels like dishing out some $$$ for BASS they cant use my lib to make $$$. Hell, now I'm even more confused
David Stone wrote:
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
Hi,
I want to create my control witch have collection (containing only MyControlItem objects) as a property.
(Something like ImageList with property called Images )
And I want to use Collection Editor (in design mode click on "...").
But I don't know, how to change type of objects that are added (in Collection Editor) to the collection from object to MyControlItem .
Thank you
(and i'm sorry about my english)
Tomáš Petříček
|
|
|
|
|
|
Thank you
|
|
|
|
|
I don't know how to do this
What's wrong with this:
<br />
public class DropDownItem<br />
{<br />
private string szName="";<br />
<br />
public DropDownItem() {<br />
szName="DropDownItem1";<br />
}<br />
<br />
public string Name {<br />
get {<br />
return szName;<br />
}<br />
set {<br />
szName=value;<br />
}<br />
}<br />
}<br />
<br />
public class DropDownCollection : CollectionBase <br />
{<br />
public DropDownCollection() { }<br />
<br />
public virtual void Add(DropDownItem val) {<br />
this.List.Add(val);<br />
}<br />
}
Have you got some sample source or link ?
Thank you
|
|
|
|
|
Hi
Everything seems fine
But (isnt there allways a butt?) you may need to add some extra methods to implement.
Also, implement the collection in your class as follows:
public class MyClass
{
DropDownCollection ddcol;
public MyClass()
{
ddcol = new DropDownCollection();
}
public DropDownCollection DropDownItems
{ get { return ddcol;} }
}
Nave a look at this as well, very handy for creating Strongly typed collections http://www.gotdotnet.com/userfiles/kristopher_johnson/TypedCollectionGenerator_1_3_0.zip[^]
Hope it works this time
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
|
Tomas Petricek wrote:
but I don't know why
I was thinking about this. Perhaps it needs the indexer or the GetValueAt() functions implemented.
OK I looked at the CollectionEditor's docs:
Notes to Inheritors: This editor can edit collections that have an Item property. The editor can determine the type of the collection from the Item property, if it exists. If the collection does not have this property, or if you want to provide collections of more than one type, you can override certain protected members of this class to customize the editor to support other types of collections.
Cheers
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
That's it
|
|
|
|
|
Hello everybody,
I have a strange problem with DrawString in my OnPrintPage event handler I need to print a few lines of text (field names) that is right-aligned. I'm using StringFormat to set the text alignemt and a RectangleF instance to set the coordinates. This is the code snippet:
StringFormat formatRight=new StringFormat();<br />
formatRight.Alignment=StringAlignment.Far;<br />
....<br />
RectangleF rectRight=new RectangleF(m_nMarginLeft+80,m_nMarginFields, 50, 30);<br />
e.Graphics.DrawString("Field name 1:", m_fontField, Brushes.Black, rectRight, formatRight);<br />
e.Graphics.DrawString("Field 1 value ...", m_fontGeneric, Brushes.Black, rectRight.Right, (float)(rectRight.Top-0.5));<br />
<br />
rectRight.Offset(0,m_fontGeneric.GetHeight(e.Graphics));<br />
e.Graphics.DrawString("Looong field name 2:", m_fontField, Brushes.Black, rectRight, formatRight);<br />
e.Graphics.DrawString("Field 2 value ...", m_fontGeneric, Brushes.Black, rectRight.Right, (float)(rectRight.Top-0.5));<br />
...
(Page units are milimeters) The problem is, that the fields are actually not exactly right aligned. The longer the text is, the more it is offset to the left (i.e. when printing it makes some 2 milimeters difference for field names which are twice/half the size of each other). The same thing happens when I use one multi-line string in a rectangle of larger height. I have absolutely no clue of what can be wrong? Therefore any clues are highly appreciated Am I doing something stupid or what? Thanks for any help.
Have a nice day,
Rado
|
|
|
|
|
Hi,
I can use Directory.GetLogicalDrives() method to get the drives attached to the computer but it only returns an array of strings which contain the drive letters (i.e. A:\, C:\, D:\, etc). What I want to know is how can I get the volume names and is there a way to find out the type of drive (floppy, hard drive, CD-ROM, networked) within the .NET framework. I noticed in the SDK documentation that there appears to be a VB.NET function that will get the volume names, but there doesn't appear to be one for C#.
Thanks
WJ
|
|
|
|
|
Wjousts wrote:
I noticed in the SDK documentation that there appears to be a VB.NET function that will get the volume names, but there doesn't appear to be one for C#.
MSDN is full of errors. If it is .NET any language can be used BTW what is the "VB.NET function" called?
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
I think it was the dir() function described here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctdir.asp
At least I think that was the one I was looking at earlier, it so bloody hard to find anything in MSDN and even harder to find it again. Anyway, it appears to be a function that is specific to VB and not part of the .NET framework itself. I couldn't find the same function anywhere within the .NET class library. What gives?
|
|
|
|