Click here to Skip to main content
15,900,461 members
Home / Discussions / C#
   

C#

 
QuestionThreading Pin
caradri30-Oct-08 3:25
caradri30-Oct-08 3:25 
AnswerRe: Threading Pin
Eddy Vluggen30-Oct-08 4:10
professionalEddy Vluggen30-Oct-08 4:10 
AnswerRe: Threading Pin
Giorgi Dalakishvili30-Oct-08 4:13
mentorGiorgi Dalakishvili30-Oct-08 4:13 
QuestionModal Dialog Behavior Problem Pin
selcuks30-Oct-08 3:19
selcuks30-Oct-08 3:19 
QuestionCan somebody translate this and tell me what it means Pin
netJP12L30-Oct-08 2:53
netJP12L30-Oct-08 2:53 
AnswerRe: Can somebody translate this and tell me what it means Pin
led mike30-Oct-08 6:02
led mike30-Oct-08 6:02 
AnswerRe: Can somebody translate this and tell me what it means Pin
Dave Kreskowiak30-Oct-08 6:15
mveDave Kreskowiak30-Oct-08 6:15 
QuestionForcing Usercontrol to forward focus to its current child control Pin
AndrusM30-Oct-08 2:28
AndrusM30-Oct-08 2:28 
I have UserControls in MDI child forms containing TextBoxes and other controls.
When user re-activates form, I need that Control which was last activated is activated again.
Currently *first* control is activated always.

To reproduce:

1. Run code.
2. Make TextBox2 as current TextBox by selecting its text
3. Activate other form
4. Activate previous form by clicking in form title bar

Observed:
TextBox1 receives focus

Expected:
TextBox2 should receive focus

How to force UserControl to forward focus to child its current child control (TextBox2) ?


using System.Windows.Forms;<br />
public class Test<br />
{<br />
    static void Main()<br />
    {<br />
        Application.Run(new MainForm());<br />
    }<br />
}<br />
<br />
class MainForm : Form<br />
{<br />
    public MainForm()<br />
    {<br />
        WindowState = FormWindowState.Maximized;<br />
        IsMdiContainer = true;<br />
        Form frm = new Childform();<br />
        frm.MdiParent = this;<br />
        frm.Show();<br />
        Form frm2 = new Childform();<br />
        frm2.MdiParent = this;<br />
        frm2.Show();<br />
        frm2.Left = 2000;<br />
    }<br />
}<br />
<br />
class Childform : Form<br />
{<br />
    public Childform()<br />
    {<br />
        Controls.Add(new Mycontrols());<br />
    }<br />
}<br />
<br />
class Mycontrols : UserControl<br />
{<br />
    public Mycontrols()<br />
    {<br />
        TextBox tb1 = new TextBox();<br />
        tb1.Text = "TextBox1";<br />
        TextBox tb2 = new TextBox();<br />
        Controls.Add(tb1);<br />
        tb2.Top = 100;<br />
        tb2.Text = "TextBox2";<br />
        tb2.Select();<br />
        Controls.Add(tb2);<br />
    }<br />
}


Andrus

QuestionCannot implicitly convert type 'System.DateTime' to 'string' error is rising Pin
Samiullah30-Oct-08 1:20
Samiullah30-Oct-08 1:20 
AnswerRe: Cannot implicitly convert type 'System.DateTime' to 'string' error is rising Pin
TommyTomToms30-Oct-08 1:23
TommyTomToms30-Oct-08 1:23 
AnswerRe: Cannot implicitly convert type 'System.DateTime' to 'string' error is rising Pin
CPallini30-Oct-08 1:28
mveCPallini30-Oct-08 1:28 
GeneralRe: Cannot implicitly convert type 'System.DateTime' to 'string' error is rising Pin
EliottA30-Oct-08 2:17
EliottA30-Oct-08 2:17 
QuestionHow i can connect with MySql Database Pin
wasimsharp30-Oct-08 1:02
wasimsharp30-Oct-08 1:02 
AnswerRe: How i can connect with MySql Database Pin
Sami Sammour30-Oct-08 2:36
Sami Sammour30-Oct-08 2:36 
GeneralRe: How i can connect with MySql Database Pin
wasimsharp30-Oct-08 18:06
wasimsharp30-Oct-08 18:06 
QuestionChecked & unChecked event for tree view using javascript Pin
anithagaraga30-Oct-08 0:20
anithagaraga30-Oct-08 0:20 
AnswerWrongForumException detected... Pin
Mbah Dhaim30-Oct-08 0:34
Mbah Dhaim30-Oct-08 0:34 
AnswerRe: Checked & unChecked event for tree view using javascript Pin
kirri003730-Oct-08 2:51
kirri003730-Oct-08 2:51 
AnswerRe: Checked & unChecked event for tree view using javascript Pin
Paul Conrad30-Oct-08 4:26
professionalPaul Conrad30-Oct-08 4:26 
Question[Message Deleted] Pin
DJ24530-Oct-08 0:18
DJ24530-Oct-08 0:18 
AnswerRe: Changing a datagridview's combobox items based on another combobox Pin
leppie30-Oct-08 0:46
leppie30-Oct-08 0:46 
Questionref parameter Pin
arkiboys29-Oct-08 23:45
arkiboys29-Oct-08 23:45 
AnswerRe: ref parameter Pin
Mbah Dhaim30-Oct-08 0:12
Mbah Dhaim30-Oct-08 0:12 
GeneralRe: ref parameter Pin
arkiboys30-Oct-08 3:20
arkiboys30-Oct-08 3:20 
AnswerRe: ref parameter Pin
CPallini30-Oct-08 1:29
mveCPallini30-Oct-08 1:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.