|
I have a gui application and part of its function is to query active directory and return search results. It writes these results to a textbox line by line.
I would like to double click on a line to select that specific line, load it into a string and then parse data out of that line with code in the background.
How can I handle the double click/line selection event? Thanks!
|
|
|
|
|
There is no "line selection event". There's a click-event, but that does not tell you which line - although you could assume that the line was clicked where the cursor is located on.
If you're reading it line by line, and presenting as such, why not use a listbox?
Bastard Programmer from Hell
|
|
|
|
|
You should use a ListBox, not a TextBox, for anything that is line oriented. It is much faster (it can handle millions of items), and easier to program too. With respect to TextBox, the one thing you have to add yourself, if you need it, is some kind of "Save All to Text File" if you ever need that.
BTW: you can easily apply simple formatting, again line-oriented, as is shown here: http://www.perceler.com/articles1.php?art=asyncpool1[^]
|
|
|
|
|
If I were doing this, I wouldn't use a TextBox . You have effectively turned the TextBox into an editable ListBox , and this really doesn't sound like the effect you are trying to achieve.
So, replace the TextBox with a ListBox , and then simply handle the SelectedValueChanged event.
|
|
|
|
|
Thank you, the listbox worked great and I'm ready to put out a test version of my application.
I just recently started getting this error, do you all have any idea what is causing this? I remember googling it and not coming up with much, hopefully I missed it and this is something easy.
Error 2 An error occurred while signing: Failed to sign bin\Debug\app.publish\\setup.exe. SignTool Error: ISignedCode::Sign returned error: 0x80070057
The parameter is incorrect.
SignTool Error: An error occurred while attempting to sign: bin\Debug\app.publish\\setup.exe
|
|
|
|
|
When are you signing your assembly? It could be that you are signing it in the build phase, and then attempting to resign it in the publish phase - which would cause this error.
|
|
|
|
|
I have never touched this feature before this started happening.
All of the sudden this started happening a month ago. I was writing a small script then so I just took the debug executable and used it, chalking it up to a fluke but now it is happening on this next application and I can't seem to fix it. I also created a brand new application windows form and added a single button that popped up a message box. I tried to publish this and I'm getting the same error.
Can you tell me how I can check for what you've stated might be happening?
|
|
|
|
|
That sounds great everyone, I will use a listbox instead and report back.
Thank you for the help.
|
|
|
|
|
No problem. Glad to help.
|
|
|
|
|
Hi All,
I am wondering if the correct way to handle installing third party drivers is to call
them. I need to use a Microchip driver and would like to know if it's good practice (what might I break) to install the driver from the windows installer (using a script) with out checking if it already has been installed or install it every time it is installed?
Glenn
|
|
|
|
|
glennPattonWork wrote: if it's good practice (what might I break) to install the driver from the
windows installer (using a script) with out checking if it already has been
installed or install it every time it is installed?
No. Your installer should account for the fact that a later version of the driver might have been installed. You could well break other parts of their system if your application just blindly installs the older driver.
|
|
|
|
|
That is what I'm afraid of doing (I am a small part of a huge project). I just don't want to appear completely amateur when my part does not work due to the wrong driver being installed. Is there a way of checking if the driver has been added to usbser.sys with out causing problems? I am at a loss, how do I go about checking the value I have looked over MSDN but they seem to be overly interested in Win 8 or CE5?
Glenn
modified 28-Jun-12 11:03am.
|
|
|
|
|
You could add a custom step in your installer and execute the following code to find the driver:
public static Dictionary<string, string> GetDriverInfo(string driverName)
{
Dictionary<string, string> driver = new Dictionary<string, string>();
System.Management.SelectQuery query = new System.Management.SelectQuery("Win32_SystemDriver");
query.Condition = string.Format("Name='{0}'", driverName);
System.Management.ManagementObjectSearcher searcher = new System.Management.ManagementObjectSearcher(query);
System.Management.ManagementObject manageObject = searcher.Get();
if (manageObject != null)
{
driver.Add("PathName", manageObject["PathName"]);
driver.Add("Description", manageObject["Description"]);
driver.Add("State", manageObject["State"]);
driver.Add("StartMode", manageObject["StartMode"]);
}
return driver;
}
|
|
|
|
|
Thanks for that I will have to give it ago, looks like the huge Friday task is off tomorrow, I will have to get playing with that Thanks again!
|
|
|
|
|
No problem. Glad we can help.
|
|
|
|
|
Sorry to reopen this can O worms, but I have been playing (dangerous I know!) and am now
can you tell me where to put the code you suggested yesterday (also can you point me to source about deployment other than the one I am using Wrox's Effective Visual Studio .NET (written and tested for the final release of .NET 1.0), the spine is now yellow from sitting on a book shelf in the Sun for a long time!)
Glenn (sorry!)
modified 29-Jun-12 7:24am.
|
|
|
|
|
Quickly, I have been playing (Days like this are vital, you discover so many things!) and found the Setup Wizard, I have always avoided it (I tend to avoid things like that in MS project as Clippy springs to mind), I must say I found it not a million miles different from the VB6 installer....
|
|
|
|
|
Hi,
I need to explain this abit....
I am using MySQL awith C# to develop Windows Form application..
I have the following tables:
CREATE TABLE `salary_slip_category` (
`salary_slip_category_id` int(11) NOT NULL AUTO_INCREMENT,
`salary_slip_category_name` varchar(255) DEFAULT NULL,
`salary_slip_category_plus_or_minus` varchar(1) DEFAULT NULL,
`salary_slip_category_default_description` varchar(255) DEFAULT NULL,
`salary_slip_category_order` int(11) DEFAULT NULL,
PRIMARY KEY (`salary_slip_category_id`),
KEY `idx_salary_slip_category_salary_slip_category_name` (`salary_slip_category_name`),
KEY `idx_salary_slip_category_salary_slip_category_plus_or_minus` (`salary_slip_category_plus_or_minus`),
KEY `idx_salary_slip_category_salary_slip_category_default_descriptio` (`salary_slip_category_default_description`),
KEY `idx_salary_slip_category_salary_slip_category_order` (`salary_slip_category_order`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `salary_slip_details` (
`salary_slip_details_id` int(11) NOT NULL AUTO_INCREMENT,
`employee_number` int(11) DEFAULT NULL,
`is_benefit` bit(1) DEFAULT b'0',
`salary_slip_details_order` int(11) DEFAULT '999',
`trxn_code` varchar(50) DEFAULT NULL,
`salary_slip_id` int(11) DEFAULT NULL,
`salary_slip_code` int(11) DEFAULT NULL,
`salary_slip_month` int(11) DEFAULT NULL,
`salary_slip_year` int(11) DEFAULT NULL,
`salary_slip_details_category` varchar(255) DEFAULT NULL,
`salary_slip_category_plus_or_minus` varchar(1) DEFAULT NULL,
`salary_slip_details_description` varchar(255) DEFAULT NULL,
`salary_slip_details_amount` double(10,3) DEFAULT NULL,
`salary_slip_details_released` bit(1) DEFAULT b'0',
PRIMARY KEY (`salary_slip_details_id`),
KEY `idx_salary_slip_details_employee_number` (`employee_number`),
KEY `idx_salary_slip_details_is_benefit` (`is_benefit`),
KEY `idx_salary_slip_details_salary_slip_details_order` (`salary_slip_details_order`),
KEY `idx_salary_slip_details_trxn_code` (`trxn_code`),
KEY `idx_salary_slip_details_salary_slip_id` (`salary_slip_id`),
KEY `idx_salary_slip_details_salary_slip_code` (`salary_slip_code`),
KEY `idx_salary_slip_details_salary_slip_month` (`salary_slip_month`),
KEY `idx_salary_slip_details_salary_slip_year` (`salary_slip_year`),
KEY `idx_salary_slip_details_salary_slip_details_category` (`salary_slip_details_category`),
KEY `idx_salary_slip_details_salary_slip_category_plus_or_minus` (`salary_slip_category_plus_or_minus`),
KEY `idx_salary_slip_details_salary_slip_details_description` (`salary_slip_details_description`),
KEY `idx_salary_slip_details_salary_slip_details_amount` (`salary_slip_details_amount`),
KEY `idx_salary_slip_details_salary_slip_details_released` (`salary_slip_details_released`)
) ENGINE=InnoDB AUTO_INCREMENT=171 DEFAULT CHARSET=utf8;
CREATE TABLE `employee` (
`employee_number` int(11) NOT NULL AUTO_INCREMENT,
`id_number` varchar(255) DEFAULT NULL,
`employee_name` varchar(255) DEFAULT NULL,
`employee_gender` varchar(11) DEFAULT NULL,
`employee_designation` varchar(255) DEFAULT NULL,
`date_of_birth` date DEFAULT NULL,
`employee_email` varchar(255) DEFAULT NULL,
`employee_mobile` varchar(255) DEFAULT NULL,
`employee_home_tel` varchar(255) DEFAULT NULL,
`date_of_join` date DEFAULT NULL,
`last_working_date` date DEFAULT NULL,
`bank_name` varchar(255) DEFAULT NULL,
`bank_account` varchar(50) DEFAULT NULL,
`current_employee` bit(1) DEFAULT b'1',
`is_active` bit(1) DEFAULT b'1',
`login_password` varchar(255) DEFAULT NULL,
`login_pin` varchar(4) DEFAULT NULL,
`created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`employee_number`),
KEY `idx_employee_id_number` (`id_number`),
KEY `idx_employee_employee_name` (`employee_name`),
KEY `idx_employee_employee_gender` (`employee_gender`),
KEY `idx_employee_employee_designation` (`employee_designation`),
KEY `idx_employee_date_of_birth` (`date_of_birth`),
KEY `idx_employee_employee_email` (`employee_email`),
KEY `idx_employee_employee_mobile` (`employee_mobile`),
KEY `idx_employee_employee_home_tel` (`employee_home_tel`),
KEY `idx_employee_date_of_join` (`date_of_join`),
KEY `idx_employee_last_working_date` (`last_working_date`),
KEY `idx_employee_bank_name` (`bank_name`),
KEY `idx_employee_bank_account` (`bank_account`),
KEY `idx_employee_current_employee` (`current_employee`),
KEY `idx_employee_s_active` (`is_active`),
KEY `idx_employee_login_password` (`login_password`),
KEY `idx_employee_login_pin` (`login_pin`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
I am using the salary_slip_details to view the salary details, linking it with employee_number in the employee table and also linking it to the salary_slip_category to view it by category
I want to know how can I make the result showing like this:
1. every employee will have one row.
2. Categories will be shown as columns and total amount of the category will be shown there
so if the employee has 2 record of decution (category) 10 dollar each the in the deduction column it will show 20$ for that employee
kindly help....
|
|
|
|
|
Try something and if you face issues with your code, kindly post your code here.
No one is going to write a program for you.
|
|
|
|
|
oh I am sorry! I only speak English..
You can try http://translate.google.com[^] if you didn't understand my post
My post was how to do it NOT PLEASE WRITE A CODE FOR ME!!
Hope it's clear now...
|
|
|
|
|
This really should have been posted in the database forum because it's really about the retrieval of the data. If I were you (and this is a big hint on how to get the data into one row), I would read the links on this[^] page, paying particular attention to the Pivot section. Just saying, that's all.
|
|
|
|
|
I understand that it is possible for a link in MS Excel to open another MS Excel using OpenXML SDK. Need to create Hyperlinks object and append it to Worksheet object. Now would like to know how we can manage authentication of the new document that is opened.
For Example: In web application, say one doc is already downloaded from server to browser, and user clicks on a link in that document which connects to another doc in the server.
How this clicking on link request will be authenticated? Will that be taken care by browser or should we create a new session cookie for that and authenticate? In OpenXML is there anyway if this can be managed easily without the end user knowing how this takes place.
Please share your thoughts on the request. Thanks alot for your help!
Regards, Rijesh
|
|
|
|
|
|
thanks, I have moved the post to the .Net discussion board..
|
|
|
|
|
I am in the the process of building an iphone app that would access MSSQL database through a RESTful WCF. At the heart of my iphone app, customer will plug their info, take a pic, maybe audio file and small txt file along with some other simple info to update database. I was thinking, I would bundle all that up in some object and post it via HTTP into WCF, which then updates the db.
I have some doubts about this as WCF expects One Stream parameter, and nothing else along in same method, So Stream parameter can't be part of the object.
I would like to deal with JSON. Does anyone have an idea of what's the best way to do this? Note, I am able to post txt file, Stream Image file as seperate methods at the moment. I am hoping to bundle that up and make one post request to get that done.
Thanks
|
|
|
|
|