Thanks for taking the time to detail your response Griff...!!!
rfresh
Posts
-
Why doesn't my code find the .SelectedIndex? -
Why doesn't my code find the .SelectedIndex?I don't understand why my code snippet below won't find "14" and set the .SelectedIndex? The .Selectindex is always -1.
comboBoxLSKFontSize.Items.Add("10";);
comboBoxLSKFontSize.Items.Add("11";);
comboBoxLSKFontSize.Items.Add("12";);
comboBoxLSKFontSize.Items.Add("13";);
comboBoxLSKFontSize.Items.Add("14";);
comboBoxLSKFontSize.Items.Add("15";);
comboBoxLSKFontSize.Items.Add("16";);
stringLSKFontSize = "14";
i = 0;
foreach (string str in comboBoxLSKFontSize.Items)
{
if (stringLSKFontSize == str)
{
comboBoxLSKFontSize.SelectedIndex = i;
break;
}
i++;
} -
Winform inter-communications between appsI have a game app that has a window in it and was designed to be interacted with using only the keyboard. I find it very difficult to do this and was wondering if it was possible to write an app that would allow me to use the mouse on this first app to control it? I'm thinking, if this is possible at all, that my small app would detect mouse clicks on the game app and feed into its keyboard buffer the keys it 'thinks' it is receiving from the keyboard. Is this possible at all? Thanks...
-
Setting A Global Hot Key On A Second FormI don't want a global hot key to START my forms. I stated: "I do not need the main form to do this any more. I just used the main form to test my Global Hot Key code." I want to show and hide my second form with a global hot key and my code above isn't working to do that. Thank you...
-
Setting A Global Hot Key On A Second FormI created a WinForm app in C# using VS 2013 Express. I added code to create a Global Hot Key on the main form. This works fine. My hot key is Ctrl-T. I can press the hot key and make the main form show and hide. Then I created a second form (ChecklistForm) and now I want to press ctrl-T and make that form show and hide. I do not need the main form to do this any more. I just used the main form to test my Global Hot Key code. So I'm having trouble getting the second form to respond to the hot key. When I put a break on the WndProc(), there is no break. Thanks for any help. re lang="c#"> public partial class MainForm : Form { [DllImport("user32.dll")] public static extern IntPtr FindWindow(String sClassName, String AppName); private IntPtr thisWindow; private GlobalHotKeys hotkey; public MainForm() { InitializeComponent(); } private void MainForm_Load(object sender, EventArgs e) { ChecklistForm frm = new ChecklistForm(); frm.Show(); thisWindow = FindWindow(null, "ChecklistForm"); //thisWindow = FindWindow(null, "MainForm"); hotkey = new GlobalHotKeys(thisWindow); hotkey.RegisterHotKeys(); } private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { thisWindow = FindWindow(null, "ChecklistForm"); //thisWindow = FindWindow(null, "MainForm"); hotkey = new GlobalHotKeys(thisWindow); hotkey.UnRegisterHotKeys(); } protected override void WndProc(ref Message keyPressed) { if (keyPressed.Msg == 0x0312) { thisWindow = FindWindow(null, "ChecklistForm"); //thisWindow = FindWindow(null, "MainForm"); IntPtr i = keyPressed.WParam; // not being used ShowChecklist ShowChkList = new ShowChecklist(thisWindow); ShowChkList.execute(); } base.WndProc(ref keyPressed); } } class GlobalHotKeys // CLASS FILE ********************* { public enum fsModifiers { Alt = 0x0001, Control = 0x0002, Shift = 0x0004, Window = 0x0008 } private IntPtr _hWnd; public GlobalHotKeys(IntPtr hWnd) { this._hWnd = hWnd; } public void Registe
-
How to change BG color of tree node on click eventBill, Thanks for the pointers...I will get Charles' book.
-
How to change BG color of tree node on click eventBTW, I placed my cursor on the 'TreeNodeMouseClickEventArgs' argument in VS 2012 and pressed F1 for the MSDN help on what that 'e' represents and it mentioned nothing about it. What is that called anyway?
-
How to change BG color of tree node on click eventThanks...with your help, I got it to work...in this case with that little 'e' arg:
private void treeView\_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Checked) { e.Node.BackColor = Color.Yellow; } else { e.Node.BackColor = Color.White; } }
-
How to change BG color of tree node on click eventI'll post in the Q&A as you suggest. I'm a bit older and the C# and .net coding is harder for me to grasp. I do spend a lot of time googling for answers but often the code I find I just don't understand it. For example, I do see that Sender arg a lot and try to use it like Sender.Checked on a node checkbox but that doesn't work. I also see the e args and try using e.Checked and that doesn't work. sometimes the this. member works ok and other times not. Seems to me if your coding in C# that the C# group would be where one should post vs the Q&A but I'm sure you have a reason for asking me to not post here in C#.
-
How to change BG color of tree node on click eventThumbs up...thanks...
-
How to change BG color of tree node on click eventI have a Treeview with checkboxes. I want to be able to click on a checkbox and change the node BG color. If the checkbox is unchecked then I want to default BG color. I've searched around and saw some things that were close but didn't exactly do both of these things. Thanks for any help...
-
Renaming a solution helpIn VS 2012 Express, I created a solution called syncpro and then renamed it multisyncpro in the solution window by using F2 and renaming the solution and then the project. I noticed however, in the folder structure MyDocuments multisyncpro syncpro etc. that the second-level folder is still called syncpro. In a solution that has not been renamed, the two folders are the same name. If I rename that folder outside of VS the solution won't load. How can I rename this folder so it matches the new name of multisyncpro? Thanks...
-
settings.settings property is read-only?Yep, I went to look again and finally figured that out!!! Up vote to you Bill...!!
-
Added 'Menu' to VS 2012 Express toolbox but its disabledI added the 'Menu' item to VS 2012 Express (using C#) toolbox but its disabled. At work I'm using VS 2012 Premium and added the Menu item to the toolbox and it did not disable it and thus I could make use of it. Anyone know why the Express version might be disabling the Menu component on the toolbox menu? Thanks...
-
settings.settings property is read-only?Bill, this is the oddest site to find things, you mention before to delete a message and repost it but there was no way to delete. Now you're suggesting I vote a thank you which I 100% agree with but I don't see anything regarding voting. Strangest site!
-
settings.settings property is read-only?Ahhhh...yes, the difference (for me) was that I had some items set to Application and thus they were read-only. I changed them to User and can now save their data. Thanks Bill.
-
settings.settings property is read-only?I'm trying to save one of my settings.settings fields when I close my VS 2012 C# app but I'm getting an error saying this is a read-only property. Where so I change it to read/write? Thanks...
private void FormMain\_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.emailAddress = "someone@isp.com"; }
-
Treeview node folder imagesThe Delete link is disabled so I can't delete it to move it. I did a search and 'figured out' that I could populate the imagelist property in my treeview with my needed images. I have a brown folder for directories and a green folder for files but in my code below, the folders don't get the brown folder icon and the one file does not get the green folder! I thought after I understand finally that the index into the images could be used to set the folder icon. Below in directory loop I'm setting 0 index which has the brown folder and the loop below that one is for files and I set index 1 which is the second green folder image.
foreach (var directory in directoryInfo.GetDirectories())
{
var childDirectoryNode = new TreeNode(directory.Name) { Tag = directory };
currentNode.Nodes.Add(childDirectoryNode);
currentNode.ImageIndex = 0;
stack.Push(childDirectoryNode);
}
foreach (var file in directoryInfo.GetFiles())
{
currentNode.Nodes.Add(new TreeNode(file.Name));
currentNode.ImageIndex = 1;
} -
Treeview node folder images(1) I searched outside of this forum but I will search inside and see what I can find. (2) I don't see a way to move a topic? I don't see a Move button or link. I'd be glad to move this to QA if I can see how to do that. Thanks...
-
Treeview node folder imagesI'm trying to add folder images to my treeview component. I have looked at some examples but cannot quite understand the process. I think I have to start with setting my images resources in an ImageList object right? I'm not sure how to do that. Then as I build my treeview, how do I detect a folder from a file and if a folder, set an image to it to display a folder? Thanks for any help.