|
Hi to all,
In my DataGridView, I have 1st Column as "Unique-ID", which must be unique.
And the DataSource to the DataGridView is an XML File ( containing 'Unique-ID' in numeric & 'ID-Detail' in text format which is shown in DataGridView).
I want to sort "Unique-ID" Column on 'ColumnHeaderClicked' event in numeric format not in string format. What should I do for that?
Plz., guide me.
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
I want to read the security key value from App.config file. Below is the procedure which I did :
Create a new config file name as App.config
In the App.config file:
<configuration>
<appsettings>
<add key="SecurityKey" value="MyNewKey">
After that I did the following:
System.Configuration.AppSettingsReader settingsReader
= new AppSettingsReader();
when i am debugging these, i find that the value of dimension is 0 which supposed to 1. since there is one key-value present in the App.config
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
Also it's throwing an exception stating
“The key "SecurityKey" does not exist in the appSettings configuration section”.--which already present in the App.config.
Also i tried with the second scenario:
string key =
System.Configuration.ConfigurationManager.AppSettings["SecurityKey"];
which giving me the key value null.
Do i required to do some setting for reading the "SecurityKey" Value?
Needs help!
Thanks
Sudhir Kumar
Sudhir Kumar
|
|
|
|
|
Hey guys
my little "robot application" is coming along nicely now, but ive hit ANOTHER wall lol
basically i want to wait until a certain Edit field comes back into focus on a different application running on windows... Ive tried using Win32.GetFocus() to return the handle to the currently selected window, but that only seems to work for the calling thread...
Win32.GetForegroundWindow() allows me to get the handle to the current application, however i need the Edit field that is current focused (has the cursor in ready for input)...
is there any other way of finding this out from a differnent application sat in the system tray?
Cheers!!
Will
|
|
|
|
|
hi all,
when a user attempts to close my application,i show him/her a confirmation messagebox. (with YesNo options.
but the problem is: the X (close cross) button on the right up corner is disabled.
why ? why is that button disabled ? and how can i make it enable again ?
cos the user should both press No or that X button not to exit the program ?
Thanks in advance, bye.
MFA
|
|
|
|
|
Use MessageBoxButtons.YesNoCancel
If you only use YesNo , then clicking the X-Button is not a valid option, that's why it is disabled. Adding the "Cancel" property is the correct way to do it.
But for a confirmation to close the app I'd use OkCancel , because "No" and "Cancel" have virtually the same meaning in this case, yet the MessageBox has two different buttons. Kinda confusing.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all, I'm creating a touchscreen form, so what I need to know is if there is anyway that I can change the look of the buttons, from square to round buttons, and just round the edges of the buttons.
I have images that I want to put on top of the buttons so I need to be able to change the form of the buton.
Any help will be appreciated.
Thanx in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
I think there are some artciles here on CP covering this topic.
"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
|
|
|
|
|
Hi,
There are several ways to create a button but not to be a button .
I used to play with PictureBoxes in which I used to load images that look like buttons. If you set the backcolor to Transparent and place inside the PictureBox an PNG file with transparent background you obtain a kind of button. If you want your "button" to be "alive" try changing the image in MouseEnter and MouseLeave event with images that look almost like the original one.
Static buttons i used to create on my background image of the form and place above them a label and at the Click event on the label do the work. It's not very pleasant but it works.
Do your best to be the best
|
|
|
|
|
|
Anyone tried this?
http://www.itu.dk/research/c5/[^]
If so, how does it compare to PowerCollections? It seems more powerful and I get the impression that it has a steeper learning curve.
Kevin
|
|
|
|
|
Kevin McFarlane wrote: If so, how does it compare to PowerCollections?
Personally, I have never had much use for it, and it seemed unnecesarily bloated. Thanks for the link
|
|
|
|
|
Hi All
I have a blank windows form running on .net 1.1. At runtime, I load controls dynamically from an XML file which is all fine. I now need to register events for the controls dynamically define somewhere in the XML file. Is this possible? As my requirement is to generate the controls and define its events in XML file, I don't want to use factory model.
I have tried using addhandlers and eventhandlers but no success yet.
Thanks
Mustafa
www.hostukdomain.com
|
|
|
|
|
I really hate to say this, but what you are trying to do was already done for you by Marc Clifton : http://myxaml.com/[^]
This has it all, eventhandlers, components, etc. all in XML. Great tool and very mature
WM.
What about weapons of mass-construction?
|
|
|
|
|
thanks Williem...
I look forward taking a dive into it..
Mustafa
http://www.hostukdomain.com
|
|
|
|
|
HI
Guys let me know one thing how to capture the data eneterd by the user through key baord in C# , e.g. if the user presses the A key of key board so i can access the A in my code for use.plz replt ASAP,
thankx in advance
|
|
|
|
|
You write a event handler for the Key_Press (or Key_Down) event for the control you wan't to capture.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
thankx for ur response , but man i am making a window service it would be running at the back end as window process,there would be no user control in front of the user where the user enters the data and i can get the data in key press event of my application , so that would not be the case here,plz reply ASAP ,
|
|
|
|
|
Hi all,
I've been working on a Graph class for our web stats system and i'm having a few problems.
After getting some help of a few guys/gals (not sure) from here, I solved many problems and then hit another one.
I have currently got a class that generates an image of a graph which has X and Y Axis labels all correctly placed.
Now my problem is, how can I display my values in a staticly sized image?
My working space is 150hx650w. My X and Y Labels are all placed in the right place, and I need to calculate how tall I need to make my bars to reflect their value.
So my values are now : 0,0,4,0,90,172,0 (graph shows stats for the last 7 days)
At first I thought 150*value/100 would give me a percentage of the height, which I could simply draw
but when I tried it against the 172, my return value was 258.
Has anyone got any idea's on how to solve this. Maths was my strong subject at school, but i've forgotten most of it.
Thanks everyone.
Gav
|
|
|
|
|
bar = bar_max * value / value_max
For example:
bar = 150 * 172 / 172 = 150
bar = 150 * 90 / 172 = 78
|
|
|
|
|
THANK YOU!
I knew it would be simple, but I didn't think it was THAT simple.
|
|
|
|
|
Hi all,
I just want to know what i'm doing wrong when trying to access a website thru cmd. I send the command from my application to cmd prompt. "http://bulksms.2way.co.za/5567/eapi/submission/send_sms/2/2.0?username=itgoeshere&password=blahblah&message=hi+ma&msisdn=0820820820"
I want this link to run thru cmd. please help
If you know how to just run a url without sending it to command prompt (if that is easier) that would be great help
thank you in advance
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Okay, if figured out how to run a url directly from C# but i opens up my default web-browser. I want to run the url without the having the user see the url. i'm using the "Process.Start(URL)" to run the url.
Is there a way to not open any windows (like the web-browser) and still run the url?
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Take a look at the HttpWebRequest class.
"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
|
|
|
|
|
Thank you, I came across an article that gave the following code
HttpWebRequest Request;
StreamReader ResponseReader;
Request = ((HttpWebRequest)(WebRequest.Create(URL)));
ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream());
when i run the code it says: "the underlining connection was closed. The remote name could not be resolved"
What does that mean?
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
I want to add checkbox in datagrid.I know we can use
DataGridColumnStyle boolCol = new DataGridBoolColumn();
but problem is this one taking only bool value. but my column value is string.
i have to make checkbox check or uncheck depending upon the status.
status is one of the field in my table and it's containg I or A.
any solution for this.plz help me.
thanks
|
|
|
|