|
You can make it in code, so when you need check boxes just make a control of kind CheckedListBox, otherwise make it a regular ListBox. (As CheckedListBox doesn't contain any property to hide the checkboxes).
Otherwise you may create a custom control of you own to do all that stuff.
|
|
|
|
|
In the past I've used the ListView control to do this very thing. There is a handy property there called "CheckBoxes" that when enabled shows check boxes per row entry. To disable the check boxes, just set the "CheckBoxes" property to false. Of course you will have to deal with re-draw issues.
Phil
|
|
|
|
|
Hi
Ive made a program in c# with VS2005, is it possible to make a release on my program with frameworks 1.1? If it is possible can someone please help me?
Andreas
|
|
|
|
|
wrote: Ive made a program in c# with VS2005, is it possible to make a release on my program with frameworks 1.1?
If you have not taken advantage of any of the new features then it would be possible to compile the program for .NET 1.1 - but not in VS2005 itself.
|
|
|
|
|
ok, thank u for the quick answer.
|
|
|
|
|
|
If you use SharpDevelop instead of VS 2005, you can target either v1.0, 1.1 or 2.0 of the .Net Framework or even Mono and Boo.
Best of all, it's an open source project for which you can download the source code.
Hope this helps.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Thanks, im gonna try with SharpDevelop.
|
|
|
|
|
Visual Studio 2003 gives you the ability to target either 1.0 or 1.1 of the .NET framework. VS 2005 it is technically possible to target the 1.0/1.1 platform through XML settings, I have not been able to successfully accomplish this. You would have to use VS 2003 or previous to work with the specific framework.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I am creating a TreeView which lists all the directories and ".xls" in a given directory
I have created my own version of TreeView and TreeNode, just to allow my TreeNodes to have some extra information (path of the file or the directory)
The problem i am facing is once done the processing the Tree View does not show mw the nodes in the Tree. if i check the count it is OK (same no of files and directories i have) but they don't show up on thew form. So i am providing my code in a hope that some1 will have an idea what i am doing wrong.
The first part is the method that create the treeview(my version), and tries to copy the nodes from it to the TreeView (.net) .
private void createTree()
{
g_ReportsFolder = Directory.GetCurrentDirectory() + "\\Reports2";
ReportTree rtree = new ReportTree(g_ReportsFolder);
foreach (ReportNode rNode in rtree.Nodes)
{
this.tvReports2.Nodes.Add(rNode);
}
}
Note: If I use
this.tvReports2.Nodes.Add(rNode.Text);
instead of
this.tvReports2.Nodes.Add(rNode);
I can view the nodes in the treeview
This is the TreeView class that creates the list of nodes by using a recursive function createTree(DirectoryInfo p_Directory)
public class ReportTree : TreeView
{
private string ReportsFolder = "";
private DirectoryInfo Directory = null;
public ReportTree(string p_ReportsFolder)
{
ReportsFolder = p_ReportsFolder;
Directory = new DirectoryInfo(ReportsFolder);
createTree(Directory);
string s = this.Name;
}
private void createTree(DirectoryInfo p_Directory)
{
DirectoryInfo l_DirctoryInfo = null;
foreach (FileSystemInfo Report in p_Directory.GetFileSystemInfos())
{
if (isDirectory(Report))
{
createDirectoryNode(Report);
l_DirctoryInfo = new DirectoryInfo(Report.FullName);
createTree(l_DirctoryInfo);
}
else if (isXLSFile(Report))
{
createFileNode(Report);
}
else
{
continue;
}
}
}
private bool isDirectory(FileSystemInfo p_FSI)
{
if (p_FSI.Attributes == FileAttributes.Directory)
return true;
else
return false;
}
private bool isXLSFile(FileSystemInfo p_FSI)
{
if (p_FSI.Attributes == FileAttributes.Archive && p_FSI.Extension == ".xls")
return true;
else
return false;
}
private void createDirectoryNode(FileSystemInfo p_DirInfo)
{
string l_Text = p_DirInfo.Name;
string l_Name = p_DirInfo.Name.Replace(" ", "").Replace("'", "").Trim();
string l_Path = p_DirInfo.FullName;
this.Nodes.Add(new ReportNode(true, l_Name, l_Text, l_Path));
}
private void createFileNode(FileSystemInfo p_FileInfo)
{
string l_Text = p_FileInfo.Name.Remove(p_FileInfo.Name.IndexOf(".xls"));
string l_Name = l_Text.Replace(" ", "").Replace("'", "").Trim();
string l_Path = p_FileInfo.FullName;
this.Nodes.Add(new ReportNode(false, l_Name, l_Text, l_Path));
}
}
This is the class that is customization of the TreeNode. I used this to have Some Extra info like path of the file with the node
public class ReportNode : TreeNode
{
public bool isDirectory;
public string NodeName;
public string NodeText;
public string NodePath;
public ReportNode(bool p_isDirectory, string p_Name, string p_Text, string p_Path)
{
this.isDirectory = p_isDirectory;
this.NodeName = p_Name;
this.NodeText = p_Text;
this.NodePath = p_Path;
this.Text = this.NodeText;
this.Name = this.NodeName;
}
}
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
The difference between the two overloads is that the string version creates a new node; whereas the node overload just adds it to the collection. You should be getting an ArgumentException that indicates you cannot add the node in more than one place.
The solution for you is to clone the node. You'll need to override the Clone method from the TreeNode base class and make sure your properties are copied.
I also have a design recommendation for you. The ReportTree is not necessary. It appears that all of your implementation is related to creation. That is, you're not really maintaining any state in it. The Builder[^] pattern would work well for you. You'd still want the concrete tree node you created.
|
|
|
|
|
Hi,
I am designing an editor in C#. for example in searching for a text(Find)
when the searching text is found it should be highlighted.One more think,
i want to implement line number functionality in my editor.i dont know how
to do .
Please if any one knows help me.
With Thanks
Sakthi
|
|
|
|
|
SakthiSurya wrote: when the searching text is found it should be highlighted
If you are using rich text editor, you can do it easily. This control having methods to get and set the selection. Try for some richtext documentations.
SakthiSurya wrote: i want to implement line number functionality in my editor
My idea is keep one listbox near to textbox. apply all the styles for the listbox., According to the changes in richtext editor create line numbers and add to listbox. Make use of threading for better performance.
|
|
|
|
|
Of course you could do this yourself, but why should you if there are already several(three at least) controls on CodeProject which do just what you want. I have tried several of them out, and I think that for speed and functionability, the one by Uri Guy is the best. Here is the article-> Syntax highlighting textbox written in C#
|
|
|
|
|
Hi,
I am a novice of .NET. I am planning to write an application in C#.NET which is meant to serve a purpose of like "post-it" which would certainly need to be memory resident without any main window. Can I achieve this using Windows Forms name space?
Thanks
urs truly,
Mutyala Rao,
096886303653
|
|
|
|
|
Why not just hide the application window?
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
May be yes. We can hide the application window and display the "notes" windows. but there should be one source i mean an icon upon which clicked, a context menu can be displayed to configure settings or close the application if needed. For this i think its needed to show an icon in the system tray.
How can we do this?
urs truly,
Mutyala Rao,
096886303653
|
|
|
|
|
can i bind the unbounded columns in a datagridview with the columns in a database table at run time
|
|
|
|
|
Create DataTable using Dataset generated from the Adapter
And Then create a DataView and assign to Datasource of DataGrid control.
And Bind it.
Sorry if iam understood ur question incorrectly....;P
With Best Regards,
Yogesh
|
|
|
|
|
Hello Gurus,
I rememeber i read one article about this using system.management few days ago but I cant remember can anyone please help me regarding that ?
Means the qurey that i can use.
Regards,
nishu
|
|
|
|
|
This site contains many articles about WMI, look inside and you will find many good one.
|
|
|
|
|
Their should probably be a registry hive somewhere that stores the add/remove list of programs installed on the machine, I can't really help with the System.Management namespace though.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Dear all ,
I am new to C#. I want to Find Column Name which is having Primary Key from an Existing Table in MSAccess .
I tried many ways to find that but i failure to find .Please any one tell Answer for this .
Thank you .
|
|
|
|
|
I just started C# 2 weeks ago and I'm loving it.
One simple question.
btnStart.Text = "&Start";
What is the purpose of the &.
Thank you to the forum, you guys / gals are great.
|
|
|
|
|
Normally you use the "&" when naming menu items. If you run your program the character preceded by the ampersand is underlined in every menu item and you can "simulate" clicking the menu item by pressing the respective character whilst holding Alt. So it allows users to access the menu without using the mouse.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|