Salam/Hi, I have two winform, 1 named as "fudafrm" another is "loginfrm".I want to control tabs or close 3,5 and 8 tab which is located in fudafrm through loginfrm,when Id and password is correct.  fudafrm is this:     AND loginfrm is :    I tried thees code in loginfrm: (wrong codes)  if (txt_userid.Text == "user" &amp;&amp; txt_password.Text == "user")             {                 Form f1 = new fudafrm();                 TabControl.TabPageCollection("tabpage3").hide();                 TabControl.TabPageCollection("tabpage5").hide();                 TabControl.TabPageCollection("tabpage8").hide();                 this.Hide();             }             else             {                 MessageBox.Show("Invalid User Name &amp; password","Error");              }   kindly help me for controlling tabs through other forms. I am using windows form C# visual studio 2010.
34957
How to hide TabPage from TabControl in WinForms 2.0?
36111
How do I create, execute and control a winform from within a console application?
71830
I'm working with a WinForm app in C#, after I type something in a textbox I want to hit the Enter key but the textbox still has focus (flashing cursor is still in textbox), how can I achieve this?
749
I have a scenario. (Windows Forms, C#, .NET)   There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the UserControl_Load method the UI become nonresponsive for the duration for load method execution. To overcome this I load data on different thread (trying to change existing code as little as I can)   I used a background worker thread which will be loading the data and when done will notify the application that it has done its work.   Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl.    The pseudocode would look like this:  CODE 1  UserContrl1_LoadDataMethod() {     if (textbox1.text == "MyName") // This gives exception     {         //Load data corresponding to "MyName".         //Populate a globale variable List&lt;string&gt; which will be binded to grid at some later stage.     } }   The Exception it gave was     Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on.   To know more about this I did some googling and a suggestion came up like using the following code  CODE 2  UserContrl1_LoadDataMethod() {     if (InvokeRequired) // Line #1     {         this.Invoke(new MethodInvoker(UserContrl1_LoadDataMethod));         return;     }      if (textbox1.text == "MyName") // Now it wont give an exception     {     //Load data correspondin to "MyName"         //Populate a globale variable List&lt;string&gt; which will be binded to grid at some later stage     } }   BUT BUT BUT... it seems I'm back to square one. The Application again  become nonresponsive. It seems to be due to the execution of line #1 if condition. The loading task is again done by the parent thread and not the third that I spawned.  I don't know whether I perceived this right or wrong. I'm new to threading.  How do I resolve this and also what is the effect of execution of Line#1 if block?  The situation is this: I want to load data into a global variable based on the value of a control. I don't want to change the value of a control from the child thread. I'm not going to do it ever from a child thread.   So only accessing the value so that the corresponding data can be fetched from the database.
52813
Possible Duplicate:          On a create/edit form, where the options available to the end user will depend on their previous input, in order to give the user some guides on how to fill the data, we shall:   Disable the controls and enable them only when the pre-requisites are meet. Hide them instead Do nothing Other options   Example: when asking who is the legal representative of someone, the form will contain a combobox with the following options: the own person, their parents or someone else. Only in the case the user chooses someone else, he was to fill a textbox telling who.  Which option will provide the best user experience?
80476
I have two function which needs to be called from one button. Currently I am doing this by creating two button one "Confirm" and another "Save". but I don't want two button I want only one button "Save", on click of Save first the method called by "Confirm" button should be called and then the method called by "Save" button.  Below is my code:  &lt;apex:commandButton value="Confirm" action="{!save}"/&gt;    &lt;apex:commandButton value="Save" action="javascript:top.window.opener.closeFunction()" &gt;&lt;/apex:commandbutton&gt;
43168
Let's say you create a wizard in an HTML form. One button goes back, and one goes forward. Since the back button appears first in the markup when you press Enter, it will use that button to submit the form.  Example:    &lt;form&gt;   &lt;!-- Put your cursor in this field and press Enter --&gt;   &lt;input type="text" name="field1" /&gt;    &lt;!-- This is the button that will submit --&gt;   &lt;input type="submit" name="prev" value="Previous Page" /&gt;    &lt;!-- But this is the button that I WANT to submit --&gt;   &lt;input type="submit" name="next" value="Next Page" /&gt; &lt;/form&gt;     I would like to get to decide which button is used to submit the form when a user presses Enter. That way, when you press Enter the wizard will move to the next page, not the previous. Do you have to use tabindex to do this?
79093
Does a  work on the UI-thread of a WinForms application?  If yes, why? It is coming from WindowsBase.dll which seems to be a WPF component.  If not, how can I invoke work units back onto the UI-thread? I've found , but it seems clumsy to create a control only to reference the originating thread.
43111
In the Windows registry, how does CurrentControlSet differ from ControlSet001 and ControlSet002? Which should be set when installing for all users? We are trying to add an environment variable for all users. Is this correct? HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Envinronment
105821
When it is a switch between applications, we use Command+Tab, and when it is a switch within an application, we use Command+`.  Can I just use Command+Tab for all cases, as in Windows?
76874
In Windows Forms, I'd just override WndProc, and start handling messages as they came in.  Can someone show me an example of how to achieve the same thing in WPF?
96684
I am struggling with something that I think should be easily (ish).  I have a windows form and a flowgridlayout panel at the bottom of the form.  Inside this form I dynamically populate it with X number of User Controls.  The controls are all the same type.  The goal is when the user hoovers the mouse over the user control it opens another form and positions it where the mouse is.  When mouse leaves the form the opened form disappears.  This almost works great.  The problem is when the User Control has anything like a label or text box inside it.  It is considered to have left the UC so the form disappears.  My thought was then to use the X and Y to tell if it is inside the UC but I can not figure this out.  Can I ask:  1)  What is the best approach to this? 2)  How can I code it, as the UC's are dynamic I can not know exactly where they will be.  Thanks  EDIT  I am trying to figure out the mouse pointers but not getting there.  The code below is within the UC SmallTagBox_MouseLeave event:          Point loc = this.Location;         Point p = this.PointToScreen(this.Location);         Point p2 = this.PointToScreen(this.Parent.Location);          Point ms = MousePosition;         Rectangle screenBounds = new Rectangle(this.PointToScreen(this.Location), this.Size);         if (!screenBounds.Contains(ms))         {             thw.Close();             thw = null;         }    loc {X = 275 Y = 3} System.Drawing.Point p   {X = 808 Y = 908}   System.Drawing.Point p   {X = 808 Y = 908}   System.Drawing.Point p2  {X = 545 Y = 1542}  System.Drawing.Point ms  {X = 574 Y = 914}   System.Drawing.Point screenBounds    {X = 808 Y = 908 Width = 62 Height = 29}    System.Drawing.Rectangle   I do not understand how p2 (its parent) can have a greater Y value relative to the screen.
40565
I'd like to switch between two Steam accounts (from the same windows user account) without having to re-enter their passwords. So basically I am trying to write a batchfile which takes care of the relevant files and/or registry settings, but for that I need to know     Which files and registry settings change when logging in as another user?   Obvious bonus points for providing a batch file for that task.
36302
Using GNU-Screen for a long time.  C-a 1 2 n p   to navigate to other tabs. This works till 9. I often have 10, 11 etc. Is there any way to go to them quickly ?  Currently, i have to do:      C-a 9, C-a n which is quite a pain. Thanks.
25955
The Local Users and Groups Manager doesn't like running on the Home versions of Windows...    Is there an alternative program which can provide the same amount of flexibility for editing users/groups?  (Control UserPasswords2 doesn't have nearly as much flexibility, so that doesn't count.)
62035
There are two checkboxes for Run As Administrator in the Properties dialog for a shortcut in Windows 7. One is under the Shortcut tab in the Advanced Properties dialog, and the other is under the Compatibility tab.  I've seen this under Windows 7 and Windows Server 2008. It might be in Vista and other versions, but I'm not sure.  What is the difference between these two settings?
31014
I have a requirement that an application I am working on prevent the user from being able to easily capture the contents of the screen.  I have communicated that there is no feasible way to completely prevent this from happening, but I'm looking for methods to introduce some hurdles to the process.  I'm using C#/.NET 2.0 and WinForms