|
My guess was that it wants a pointer to an array instead of the array itself. My C/C++ is little more than an orange-brown stain at this point so I'm not sure what the proper syntax would look like.
The latest nation. Procrastination.
|
|
|
|
|
I need help for the following purpose:
Suppose I have a tree view and there are various items there. When I right click on a item it will display a menu which contains dynamic options in the menu.
[I have tried by context menu strip. For my tree view I have chosen the contextmenustrip1. But problem is when i right click any where on the tree view it shows the menu with static items. But I need when i will right click on any node only at that moment it should appear with some option those are available in a listbox.(The list box is dynamic)]
|
|
|
|
|
Use the ContextMenuStrip.Opening event to modify the content of your menu.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Thanks for the help. Now I can make it dynamic. But How can I just do it only for selected node? I only want that when i will click to any node then it should display the menu. Otherwise it should not display the menu if i click any place of the tree view other than any node.
|
|
|
|
|
You can rebuild the context menu every time you change selected node and just display it
OR
As suggested use the opening event and rebuild before opeing based on the currently selected node.
You may also want to look into the hittest and mousedown to select the node when you right click on it. IIRC the right click does not select the node.
|
|
|
|
|
private void yourTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
((TreeView)sender).SelectedNode = ((TreeView)sender).GetNodeAt(e.Location);
}
|
|
|
|
|
|
|
Dears , Can any one tell me How i can use listbox in Datagridview using C#.net
|
|
|
|
|
Well you could have tried using Google; it took me less than one minute to find this[^].
|
|
|
|
|
Hi,
How to enable write permission for a folder , I googled internet for some sample programs, I got few programs but these were on the basis on Domain name and User name! I would like to know how this can be achieved on a standalone system ? Do we require Domain name and User Name for changing permission of a folder?
I have attached a small program of with this issue, kindly review it, it is executing but there is write permission is not enabled with this.
using System;
using System.IO;
using System.Security.AccessControl;
using System.Windows.Forms;
namespace FileSystemExample
{
class FileExample
{
public static void Main()
{
string DomainName = System.Environment.UserDomainName.ToString();
DomainName += @"\";
string AccountName = System.Environment.UserName.ToString();
DomainName += AccountName;
try
{
string folderName = @"C:\Inetpub\ftproot";
Console.WriteLine("Adding access control entry for "
+ folderName);
AddFileSecurity(folderName,DomainName,FileSystemRights.WriteExtendedAttributes, AccessControlType.Allow);
Console.WriteLine("Removing access control entry from "
+ folderName);
RemoveFileSecurity(folderName, DomainName,FileSystemRights.WriteExtendedAttributes, AccessControlType.Allow);
Console.WriteLine("Done.");
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
public static void AddFileSecurity(string folderName, string account,
FileSystemRights rights, AccessControlType controlType)
{
FileSecurity fSecurity = File.GetAccessControl(folderName);
fSecurity.AddAccessRule(new FileSystemAccessRule(account,
rights, controlType));
File.SetAccessControl(folderName, fSecurity);
}
public static void RemoveFileSecurity(string folderName, string account,
FileSystemRights rights, AccessControlType controlType)
{
FileSecurity fSecurity = File.GetAccessControl(folderName);
fSecurity.RemoveAccessRule(new FileSystemAccessRule(account,
rights, controlType));
File.SetAccessControl(folderName, fSecurity);
}
}
}
Mike
|
|
|
|
|
You can add write permissions for local groups as well. And i guess for the "BUILTIN"'s as well.
|
|
|
|
|
Hi,
Is there any sample program which can show how to changer permissions of a folder?
Mike
|
|
|
|
|
|
i am trying to do the task in which i want to remove the last character of textbox if there is not any matching item in autocompletelist.
|
|
|
|
|
What is the problem ? Where are you stuck ? It's very easy to do. Check the Substring method of the string class.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
///What is the problem ? Where are you stuck ? It's very easy to do. Check the Substring method of the string class. ///
This is not simple as u said.., (sorry)..,
because ...
i am trying to do the task in which i want to remove the last character of textbox if there is not any matching item in autocompletelist.
autocompletelist is called by a webmethod.., i think he has to put login in web method ..
PLZ Correct me if am wrong...
Thanks
Rajesh B
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Rajesh Jalsa wrote: autocompletelist is called by a webmethod.., i think he has to put login in web method ..
Is this for a website ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
may be..,
because the question is sounds like ,this was related to webservice/web site..,
@ Question poster
clarify our doubt... !!!!!
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I just realised you had jumped in. I thought the OP was saying. Well, I guess he's another who asks a question that's vague, then never replies when people try to help.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hey rajesh thanks for rply
actually i m creating a window application
in which i m generating the auto complete source of a textbox from database
what i want to do is when user types in textbox if thr is no matching result then typed character should be removed and autocomplete dropdownlist appear again with the matching result.
i dont want to permit the user to type wrong entry
|
|
|
|
|
no it is not for a website, it is for windows application, thank you
|
|
|
|
|
thank u, its working now but the autocomplete dropdown list not coming when the last character removed
|
|
|
|
|
hey christian
sory for late rply
actually i m creating a window application
in which i m generating the auto complete source of a textbox from database
what i want to do is when user types in textbox if thr is no matching result then typed character should be removed and autocomplete dropdownlist appear again with the matching result.
i dont want to permit the user to type wrong entry
thanks for ur rply in advance
|
|
|
|
|
Could you handle that in the KeyPress event instead?
|
|
|
|