|
Google Translate produces the following:
Member 10546930 wrote: Well my question is as follows:
1. I want to export from DataGridView to Excel Custom (In espeficial what is the header).
2. When I export also generates data with graphics in excel. All custom.
Thank you in advance for your help.
It sounds like you want to generate custom Excel spreadsheets. Have a look at EPPlus[^], ClosedXML[^] or NPOI[^], any one of which should do what you need.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
There is a lot of code required to do this. There are many articles on this site and google.com to help walk you through it. I suggest you find a sample and then come back when you get stuck on a specific issue.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi, How can I adjust an application winForm to any resoluion at any computer !
|
|
|
|
|
You can make controls grow larger; there's no automatic scaling to any resolution. Look into the docking-properties.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
In practice, you can't do it in quite the way you think: you have to design it to work at any resolution in much the same way the Visual Studio does: a central space for the "work" with the "tools" and suchlike round the edges. Then it's a matter of getting the Dock and Anchor properties right to a large extent.
But if your application does not lend itself to that style of application, then it probably isn't going to work too well at all in "regular" WinForms, because although you can use Dock and Anchor to relocate and resize controls easily enough, it doesn't resize any fonts that the controls are using, so you would end up with a large button with the tiny letters "OK" in the middle, or a tiny button that doesn't fit the word "Cancel" any more.
If that is what you need, then you are better off switching to WPF, because it handles it quite well.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
It depends on what you mean when you say: "adjust."
The other responses here assume you want Controls to get bigger (or smaller ?), or adjust their locations, depending on changes in size of the Form. In general that's a no-win situation with WinForms ... as OriginalGriff points out ... other than, for selected Controls, using Dock and Anchor as recommended.
If by "adjust" you mean determining at run-time the ratio of the current screen resolution to some arbitrary pixel size of the Form/Controls in your design, based on the original screen resolution when you wrote the app: that is another matter, entirely.
Suppose you write an app with a Form size of 900x600 pixels on a machine where screen res is set to 1024x768: now someone runs that app on a machine with a screen res set to 1600x900: do you really want to try and change the Form's appearance ? I suggest you "don't go there."
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
For example if I run the application on a resolution 1024*768, it should have the same appearing and size if it runs on a resolution 800*600
|
|
|
|
|
zayno wrote: it should have the same appearing and size No, it should not.
Reread the answers given, or ask for further explanation - but just restating the question is not going to change the answer.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I cannae change the laws of physics, Captain!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Not without rebooting the universe
|
|
|
|
|
I like a man who thinks big!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
... or daring Q to change them.
("asking" is not likely to work )
|
|
|
|
|
As Eddie say, no it shouldn't.
What for example is your form going to look like on my setup?
Your form designed for 1024 x 768.
My primary monitor is in Portrait mode, not landscape - my secondary is landscape.
In Portrait mode, my resolution is 1080 x 1920 which is going to skew your form design to heck and back: it's slightly wider than your original design, and two-and-a-half times as high!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Reading what everyone else has said and giving you my own two penneth of opinion I would say - add scroll bars to the form, make it resizeable and design to the most common screen resolution in your business.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I want to show a text from textbox 1 to textbox 2 with different colors in each text,here i am using Array to get text...
|
|
|
|
|
Perhaps you should ask this in the ASP.NET forum. That would seem to be the best place to get your answer.
|
|
|
|
|
Hi,
I want to edit a winform on using mode.Iwant o allow user to change the interace and add controls without modifying the source code for example add a text box to the interface without modifying the code.
modified 24-Jan-14 4:51am.
|
|
|
|
|
It's not that simple: You can add controls (or let your user add controls) very simply: just create a new control instance, and add it to the Form.Controls collection:
TextBox tb = new TextBox();
Controls.Add(tb); (You might want to set it's Size and Location properties, but that's up to you).
The problem is that that does nothing "real" to the form - it doesn't hook up any events, it doesn't use any text the user types into the textbox for anything. And it doesn't save it so it loads like that next time.
I think you need to either think a bit more about exactly what you are trying to do, or try to explain it rather better to us - because unless we have a good idea why you want to do this, we can't easily work out what it is you need help with.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I want to create an application Winform c# that allows to edit the name of a fields or add another control and without modifying the code like in Sharepoint we can add liste button without code
|
|
|
|
|
..are you merely asking permission, or is there a specific question in the pipeline?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I assume you mean that you want the end-user at run-time to be able to edit attributes of Forms and Controls, move Controls in Forms around, and add new Controls.
If that's correct, and this is a Windows Forms project:
1. To edit properties add a PropertyGrid to your Forms from the VS ToolBox 'All Windows Controls' panel.
Hide the PropertyGrid, and make it visible as needed, setting its 'SelectedObject property to a Control, or to the Form, as required.
2. Make your Controls movable by implementing the appropriate MouseDown, MouseUp, and MouseMove EventHandlers.
3. Create some UI for adding new Controls, present it to the user.
If you have specific questions about how to implement these techniques, I suggest you post them, along with code in progress, to one of the C# QA forums.
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
Hi All,
I want to download the most recent file from a remote SFTP. To do SFTP, I am using WinSCP.
The latest file will be decided on timestamp concatenated with FileName i.e. "myfile_20140124".
suppose I have number of files available on SFTP like
myfile_20140117.xml
myfile_20140118.xml
myfile_20140123.xml
myfile_20140124.xml
myfile_20140122.xml
myfile_20140121.xml
so I want to download the most recent file i.e. myfile_20140124.xml
I am very new to C# code Please help me.
Note: I will use all this code in SSIS 2012.
Thanks
Rahul Vairagi
-----------------------------------
www.sqlserver2005forum.blogspot.com
|
|
|
|
|
Rahul, rather than using a command line utility, you can use the inbuilt FTP classes to achieve this. The basic class you are interested in is FtpWebRequest[^]. Using this, you can connect to an FTP site and then list the files (there's a Method called WebRequestMethods.Ftp.ListDirectory that you will be invoking to get these files. Now that you have your list of files, you just need to get a copy of each filename and strip out the filenames looking for the numbers at the end (don't get fancy and try regexes, simply iterate over the characters in the name until you get to the number). Find the largest number and you've got the one you're interested in.
|
|
|
|
|
Thank you Pete for your reply !!
actually I am not using .Net framework, only using C# code in SSIS which is having many limitations.
Anyway, I got my code and its working fine.
thanks again
Thanks
Rahul Vairagi
-----------------------------------
www.sqlserver2005forum.blogspot.com
|
|
|
|
|
This excellent Code Project FTP class works very well: Simple C# FTP Class[^]
(There's a slight bug, which is documented in the comments and is easy to fix; it's a one-word change.)
|
|
|
|