Click here to Skip to main content
15,113,726 members
Home / Discussions / .NET (Core and Framework)

.NET (Core and Framework)

GeneralRe: Searching for a type in a solution Pin
Alex Korchemniy25-Oct-04 12:23
MemberAlex Korchemniy25-Oct-04 12:23 
GeneralGroup box text will not display an Ampersand Pin
Tony D. Abel22-Oct-04 14:37
MemberTony D. Abel22-Oct-04 14:37 
GeneralRe: Group box text will not display an Ampersand Pin
Luis Alonso Ramos22-Oct-04 23:47
MemberLuis Alonso Ramos22-Oct-04 23:47 
GeneralRe: Group box text will not display an Ampersand Pin
Anonymous23-Oct-04 3:43
MemberAnonymous23-Oct-04 3:43 
GeneralUser Control Embedded in IE Pin
Anonymous22-Oct-04 4:50
MemberAnonymous22-Oct-04 4:50 
GeneralRe: User Control Embedded in IE Pin
Frank Hileman25-Oct-04 6:44
MemberFrank Hileman25-Oct-04 6:44 
GeneralOpen a form on socket receive Pin
Gian22-Oct-04 0:18
MemberGian22-Oct-04 0:18 
GeneralRe: Open a form on socket receive Pin
Fade (Amit BS)25-Oct-04 20:50
MemberFade (Amit BS)25-Oct-04 20:50 
The windows forms will behave abnormally when you try to access them forom a different thread then they are, and as you are probably getting the communication message on another thread you cannot directly control the forms


the .net developers have been kind enough to porvide us with the 'Invoke' method, which is a member of each and every control (forms, buttons etc.)
this allows you to tell the control (form for this matter) to do something in it's own thread

what you need to do is to create a method (sub) that creates the new form and assigns it to a variable, that method should be located in your startup form, or any other form you want to use.
<br />
    private AdminFormMember as AdminForm<br />
<br />
    Private Sub CreateNewForm() <br />
        AdminFormMember= New SocketControlForm()<br />
<br />
        AdminFormMember.Show()<br />
    End Function<br />

and Create a delegate to it like so

<br />
       private delegate sub CreateNewFormDlg()<br />

and call it from your code when you want to create to new form using the 'Invoke' method, like so:

<br />
    If (OpenAdminForm = True) then<br />
             ' Creating a delegate instance<br />
         dim CreationDelegate as new CreateNewFormDlg()<br />
             ' invoking it from the main form's thread !<br />
         MainForm.Invoke(CreationDelegate)<br />
<br />
    end if

That's it, not too complicated and it works, trust me Wink | ;)

Fade (Amit BS)
QuestionLocal time for arbitrary location? Pin
UgN22-Oct-04 0:03
MemberUgN22-Oct-04 0:03 
GeneralTransparent Controls (Compact Framework) Pin
Vinnepin21-Oct-04 14:04
MemberVinnepin21-Oct-04 14:04 
GeneralRe: Transparent Controls (Compact Framework) Pin
Alex Korchemniy25-Oct-04 12:18
MemberAlex Korchemniy25-Oct-04 12:18 
Generaldeploying .net dll for com access Pin
Verdant12321-Oct-04 10:57
MemberVerdant12321-Oct-04 10:57 
GeneralRe: deploying .net dll for com access Pin
Verdant12321-Oct-04 11:38
MemberVerdant12321-Oct-04 11:38 
GeneralIE Toolbar Pin
Member 132814121-Oct-04 5:27
MemberMember 132814121-Oct-04 5:27 
GeneralChanging the Form icon Pin
Tony D. Abel21-Oct-04 3:01
MemberTony D. Abel21-Oct-04 3:01 
Generalasynchronous udp Pin
tommy_tanaka21-Oct-04 1:40
Membertommy_tanaka21-Oct-04 1:40 
GeneralVb.Net &amp; File Pin
Meysam.Khayatan20-Oct-04 22:21
MemberMeysam.Khayatan20-Oct-04 22:21 
GeneralSetting installer properties from the command line Pin
Saed Nashef20-Oct-04 20:26
MemberSaed Nashef20-Oct-04 20:26 
GeneralMake external parameters !!! Pin
Meysam.Khayatan19-Oct-04 11:43
MemberMeysam.Khayatan19-Oct-04 11:43 
GeneralRe: Make external parameters !!! Pin
benjymous20-Oct-04 4:13
Memberbenjymous20-Oct-04 4:13 
GeneralMsgbox buttons'text Pin
Meysam.Khayatan19-Oct-04 11:41
MemberMeysam.Khayatan19-Oct-04 11:41 
GeneralAsp.Net and SqlServer data Pin
Meysam.Khayatan19-Oct-04 11:40
MemberMeysam.Khayatan19-Oct-04 11:40 
GeneralDetails about nmake command Pin
ankitdass18-Oct-04 2:13
Memberankitdass18-Oct-04 2:13 
Questionwhat is VBScript.NET Pin
bassel_z15-Oct-04 13:24
Memberbassel_z15-Oct-04 13:24 
GeneralMystified by ExpandableObjectConverter Pin
RobRichardson15-Oct-04 10:06
MemberRobRichardson15-Oct-04 10:06 

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.