Click here to Skip to main content
15,901,853 members
Home / Discussions / C#
   

C#

 
AnswerRe: why use property in class? Pin
LongRange.Shooter21-Nov-02 10:07
LongRange.Shooter21-Nov-02 10:07 
Questionhow to display bitmap in MDI form Pin
Linder Wang19-Nov-02 14:19
sussLinder Wang19-Nov-02 14:19 
I am a beginner of C#. Now I have a question about how to display bitmap files in MDI form window. Following are some code I wrote :

1. In the parent form :
m_bmp = (Bitmap)Bitmap.FromFile(openFileDialog.FileName);
Form2 frm = new Form2();
frm.MdiParent = this;
frm.SetBitmap(m_bmp);
frm.Show();


2. In the child form2 :
protected override void OnPaint (PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawImage(m_bmp, new Point(100,100));
}

About the running result, for the first time, it can successfully display a bitmap image(i1.bmp) in a child form window. But if I open another bitmap(i2.bmp) in another child form window, the previous form window will also changed to display i2.bmp.

How to solve this problem? Please help me.
GeneralCollection editor problem Pin
dacris19-Nov-02 11:24
dacris19-Nov-02 11:24 
GeneralRe: Collection editor problem Pin
leppie19-Nov-02 11:36
leppie19-Nov-02 11:36 
GeneralRe: Collection editor problem Pin
dacris19-Nov-02 12:14
dacris19-Nov-02 12:14 
QuestionUnfocus a form when it's created? Pin
Bog19-Nov-02 8:53
Bog19-Nov-02 8:53 
AnswerRe: Unfocus a form when it's created? Pin
LongRange.Shooter19-Nov-02 11:13
LongRange.Shooter19-Nov-02 11:13 
AnswerRe: I don't understand your q very well, but.. Pin
Masaaki Onishi19-Nov-02 19:20
Masaaki Onishi19-Nov-02 19:20 
GeneralSplit string by string Pin
dezoe19-Nov-02 6:43
dezoe19-Nov-02 6:43 
GeneralRe: Split string by string Pin
leppie19-Nov-02 11:12
leppie19-Nov-02 11:12 
GeneralRe: Split string by string Pin
Eric Gunnerson (msft)19-Nov-02 11:25
Eric Gunnerson (msft)19-Nov-02 11:25 
GeneralRe: Split string by string Pin
dezoe19-Nov-02 12:41
dezoe19-Nov-02 12:41 
QuestionEnabled ForeColor? Pin
Delegate19-Nov-02 6:41
Delegate19-Nov-02 6:41 
GeneralSqlReader.GetValues() problem Pin
leppie19-Nov-02 6:32
leppie19-Nov-02 6:32 
GeneralRemoving EnhancedMetafile from clipboard fails Pin
gharrison19-Nov-02 5:27
gharrison19-Nov-02 5:27 
GeneralCOM+ Windows API Pin
thematt19-Nov-02 2:52
thematt19-Nov-02 2:52 
GeneralRe: COM+ Windows API Pin
leppie19-Nov-02 11:07
leppie19-Nov-02 11:07 
GeneralRe: COM+ Windows API Pin
thematt20-Nov-02 2:21
thematt20-Nov-02 2:21 
GeneralBinding Collection to Datagrid Pin
thematt19-Nov-02 2:41
thematt19-Nov-02 2:41 
GeneralRe: Binding Collection to Datagrid Pin
leppie19-Nov-02 10:59
leppie19-Nov-02 10:59 
GeneralRe: Binding Collection to Datagrid Pin
thematt20-Nov-02 2:19
thematt20-Nov-02 2:19 
Questionhow to display the image formats (. gif) in crystal reports Pin
crodling18-Nov-02 20:24
crodling18-Nov-02 20:24 
Generalwhere to find basic discuss or tutorial about... Pin
zhoujun18-Nov-02 19:15
zhoujun18-Nov-02 19:15 
GeneralRe: where to find basic discuss or tutorial about... Pin
leppie19-Nov-02 0:08
leppie19-Nov-02 0:08 
GeneralRe: where to find basic discuss or tutorial about... Pin
zhoujun19-Nov-02 13:19
zhoujun19-Nov-02 13:19 

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.