ListView.Sorting can be set to None, Ascending, or Descending, repective to how the items will be sorted. Hope this helps. :)
dsl fahk
Posts
-
Column sort in a ListView -
Datagrid viewI think you mean that make sure that what was entered in each column is in the correct format, which you can do with regular expressions. There are a lot of articles about it, try RegexTester.asp[^] to get you started. Hope this helps. :)
-
organization chartWell.... Could you explain some more? Do you want data to be organized in a table? There are articles about this such as usingdatagrid.asp[^]. Or if you mean a chart, like a bar graph or histogram, etc., CS3DCharting.asp[^] is an article that will help you on your way. Hope this helps. :)
-
How to get data from PHP into C# Windows Application? [modified]I'm not quite sure if I understand. Do you want to take the PHP file and put into a datagrid? Or do you just want to display it as a website? (I don't know what a PHP file is) To open it you can do this....
Filestream file = new Filestream(YourPHP.PHP); StreamReader sr = new StreamReader(file); string s = sr.ReadToEnd(); //Here is where you actually do stuff with your file (put in datagrid?) sr.close(); file.close();
But you don't do that if you just want to display it in a WebBrowser. Hope this helps, but if not, let me know. :) -
In a forms app, how to get a reference to object that has focus?okay. The first one is probably going to be the hardest one to answer. I don't think the form has any methods or properties that tell you which has focus, but you could do a foreach statement which would look something like
public Control FocusedControl() { foreach (Control Ctrl in this.Controls) { if (Ctrl.Focused == true) return Ctrl; else return FocusedControl; } } }
I am not sure if it will let you return the focused control, in which case you could use a different iterationpublic Control FocusedControl() { Control FocusedCtrl = null; Int FocusIndex = 0; while (FocusedCtrl == null && FocusIndex < this.Controls.Count) { if (this.Controls[FocusIndex].Focused == true) { FocusedCtrl = this.Controls[FocusIndex]; } } return FocusedCtrl;
I think either of those will work. Then to give focus to an object all you need to know is which object you want to give focus to. MyControl.Focus(); for number 3 I think you mean without knowing the name of it, which you can store in a variable of type Control. To access properties that most controls don't have, such as the url of a webBrowser, you can use ((WebBrowser)this.Controls[FocusIndex]).url = "http://www.codeproject.com"; and finally for number 4 you know how to "store" a Control in the Control variable, and all you have to do is go back to what you named the variable, and use the Focus() method. Hope this helps. :) -
opening file with my programHello, and thanks. I can get the command prompt to work pretty well, but now I want a more graphical program. I have tried changing the code that you suggested and the code that I found at MSDN online to fit the Windows Interface template in Visual Studio 2005, but I have not been successful. I have tried searching some more for the solution, but have not found anything more about the Main(). So if you know of a website that would be helpful in creating what i am looking for, or if you have a quick simple solution, that would be very helpful. Thanks again.
-
opening file with my programI asked this earlier, and Stefan Troschtz gave me an answer (thanks), but it wasn't what i was looking for and I think it was because i didn't explain it well enough. What code should i have in my program so that when a process is started of a file, and it is the type that my program opens, my program opens it? ex. when you start a process for a website, internet explorer opens it, when you open a .psd Photoshop opens it. Basically I am asking how i should pass the filename to my program so that it opens the file it should be opening. Or if that is not what you would do, what would you do? Thanks again. :)
-
opening clicked file in my programI am confused. I want Windows to act like this: When the user double clicks the icon in Windows Explorer, it opens up the file my program opens with my program. But how do I set up my program so that this will happen? Thanks in advance.
-
OS Loader LockThanks. :) I'm definately not doing any unmanaged interop, I'm using the code the designer made for me, and it has an error with its own code. So I will turn it off.
-
OS Loader LockWhen testing one of my programs i got a Loader Lock Message from VIsual Studio 2005: LoaderLock was detected Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang. I did some testing and it occurs whenever I press a key on a program i am testing, even if there is only a form and nothing else. How should I fix this problem? I need this fixed to test my program. Thanks.
-
DataGridView ClearSelection() behaviorboth of these ways are basically cheating :)(they still work), but maybe in the onLoad you could do a foreach statement that deselects everything, and if that doesn't work, you could try making a foreach that selects every tab page once before the form is actually shown. Sorry for a lack of a better answer. X|
-
Password Viewer C#I have a password protected program, and it has the save password function. I have been logging in with it saved for a while, but now i need to move to a different computer and have forgotten my password. I want to learn more about Windows handles manipulation (if that's what it's called) and saw this as a good opportunity. If you know of any articles about this, or if you could give me a hint in the right direction, it would be a great help. Thanks.
-
Sales?I was wondering how i should sell my software over the internet if i made something worth selling. Where would i go? What should i do? Thanks.
-
Custom ControlsHello everybody, I have been trying to make my own control. I have looked at some articles such as the combo-box based color picker[^], but I still don't get how I am supposed to make my own control. If anyone has had any success with a certain article, I would greatly appreciate a link to it. Thanks.:)
-
using another program's web servicesI have a program has a few things that it gets from online that i want to use. I'm not sure if it puts it together itself, or if it simply downloads one site, changed based on the search. Is there a program that could tell me eveything that my computer downloads?
-
System.DrawingHello, recently I have been toying around with the System.Drawing namespace. But it does not seem that it ever updates even if it is in an onPaint event handler. This is all the code i put in the entire class. I changed nothing else.
public partial class Form1 : Form
{
int Cheese = 1;
public Form1()
{
InitializeComponent();
}private void Form1\_Paint(object sender, PaintEventArgs e) { //initiate Graphics MyGraphics = e.Graphics; //Brush Brush MyBrush = Brushes.Aqua; //Font Font MyFont = new Font(FontFamily.GenericSansSerif, 12); //show text MyGraphics.DrawString(System.Convert.ToString(Cheese), MyFont, MyBrush, 10, 10); //make string higher Cheese = Cheese + 1; } }
What should i be doing? (The output is constantly "1") Thanks.:)
-
Floating ImagesHello everyone, I have a form and a picture, and i want the picture to "hang" off of the form. I have tried making the background of the picture transparent, and making a background with a special color for transparency, but the image has a shadow and the color continues to show up in the shadow when it is run. What should I do differently to get this to work? Thanks.
-
DockingI want my program to be able to dock on any side of the screen and have all of the other windows to resize so that my program gets its own space. (Bad example, but kind of like the taskbar) thanks!
-
Command Prompt Showing [modified]Thanks.;P
-
Command Prompt Showing [modified]ok. I have a program that is so far only supposed to initialize DirectX. In it there are references and one file: Form1.cs. I started it as an empty project, but when i run it the command prompt shows up. Why is my application showing the command prompt? Is it somewhere in my coding? Thanks. It's probably pretty obvious... X|