on 11-13-2013 5:20 AM
Dear expert,
I design a form from screen painter and i want to show image in picture box. but when i click in picturebox show dailog box and show images but images not display in picturebox. Kindly provide me solution what can i do.
Thanks & Regards,
Sandeep Kr
Hi,
The picture-box must be bound to some data source - DBDataSource or UserDataSource.
Beni.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
In this thread there is a working example of how to do it for matrix. You can adapt it to your needs.
Best regards,
Pedro Magueija
Hi Pedro,
here is my code....
public void OpenFileDialog()
{
try
{
OpenFileDialog MyTest = new OpenFileDialog();
System.Threading.Thread ShowFolderBrowserThread;
ShowFolderBrowserThread = new System.Threading.Thread(ShowFolderBrowser);
if (ShowFolderBrowserThread.ThreadState == System.Threading.ThreadState.Unstarted)
{
ShowFolderBrowserThread.SetApartmentState(ApartmentState.STA);
ShowFolderBrowserThread.Start();
}
else if (ShowFolderBrowserThread.ThreadState == System.Threading.ThreadState.Stopped)
{
ShowFolderBrowserThread.Start();
ShowFolderBrowserThread.Join();
}
}
catch (Exception ex)
{ }
}
#region : Show Image
public void ShowFolderBrowser()
{
try
{
NativeWindow nws = new NativeWindow();
OpenFileDialog MyTest = new OpenFileDialog();
if (MyTest.ShowDialog() == DialogResult.OK)
{
oPictureBox =(SAPbouiCOM.PictureBox)oForm.Items.Item("Txt_BIMG").Specific;
}
}
catch (Exception ex)
{ }
}
#endregion
Thanks & Regards,
Sandeep kr.
Hi Sandeep,
1. check for the correct path. Its is better to give file path of project folder.
2. Sometimes image type may cause problem. so check for the image type which you are giving to picture box. .BMP and .JPG are some of the compatible format.
Best Regards.
Shekhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.