cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Windows Form

Former Member
0 Kudos

Hi All,

I created on form in Windows Application. And this form i calling in SAP. In SAP Screen Pantain form on this form i taken one button and on this button click i shows this form.

It opens and displays on Tital bar as Not Responding.

Means form stops and no operation can be perform on the form.

Thanks and Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Harish,

Write this line of code in the Item Event / Menu Event


Dim oThread1 As New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf NewFormThread))
            oThread1.SetApartmentState(System.Threading.ApartmentState.STA)
            oThread1.Start()

Private Sub NewFormThread ()
        Dim ofrm As New YourFormName
        ofrm.WindowState = FormWindowState.Normal
        ofrm.Visible = True
        ofrm.ShowInTaskbar = True
        ofrm.TopMost = True
        Application.Run(ofrm)
End Sub

Hope this helps,

Regards,

Murtaza.

Former Member
0 Kudos

Hi Murtaza,

Can u plz define application as i can not find,

Application.Run(ofrm)

Error is, 'Run' is not a member of 'SapbouiCom.Application'

For that what should i do ?

Thanks and Regards

Harish Patil

Former Member
0 Kudos

hi harish,

just include this coding in the top of ur coding...i think u may be missing this......


Private WithEvents Application[Ur Application Name] As SAPbouiCOM.Application

regards,

dileep varma.

Edited by: dileep varma on Sep 17, 2008 8:39 AM

Former Member
0 Kudos

Hi,

I already added this dll. And also added,

Private WithEvents Application As SAPbouiCOM.Application

Still i am not getting. Is there any other member which we can use instead of application ?

So what i should do ?

Thanks and Regards

Former Member
0 Kudos

hi harish,

Instead of this line Application.Run(ofrm) use this line


System.Windows.Forms.Application.Run(ofrm)

Is your problem got solved?????

regards,

dileep varma.

Former Member
0 Kudos

Hi Deelip,

Your code works fine. Thanks u very much for this code.

My last question is now my windows form work fine but when i wil close this form it not close. Open same form. Means shows this form two time. When i close again it close previouse form. After again shows two forms.

What is problem ? Why form not closeing ?

Thanks and Regards

Answers (0)