Click here to Skip to main content
15,921,660 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
Christian Graus6-Mar-08 17:25
protectorChristian Graus6-Mar-08 17:25 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
yuenli6-Mar-08 18:25
yuenli6-Mar-08 18:25 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
Christian Graus6-Mar-08 18:33
protectorChristian Graus6-Mar-08 18:33 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
yuenli6-Mar-08 18:43
yuenli6-Mar-08 18:43 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
Christian Graus6-Mar-08 18:47
protectorChristian Graus6-Mar-08 18:47 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
yuenli6-Mar-08 18:54
yuenli6-Mar-08 18:54 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
Christian Graus6-Mar-08 20:54
protectorChristian Graus6-Mar-08 20:54 
GeneralRe: How to drag & drop shape drawn by GDI+ in picture box area? Pin
yuenli8-Mar-08 4:25
yuenli8-Mar-08 4:25 
Hi!

I try to over write the onPaint event handler but it seem that got error. This is because I embeded picture box to windows host form in xaml files. Can anyone help me to solve this problem? Really thanks for the help.

XAML code:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlnsBig Grin | :-D ="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="test_drag.Window1"
x:Name="Window"
Title="Window1"
Width="516"
Height="694"
>


<Grid x:Name="LayoutRoot">
<WindowsFormsHost x:Name="host1" Background="#FFE1E0E0" AllowDrop="True" Margin="0,0,92,0" VerticalAlignment="Top" Height="312" >
<wf:PictureBox x:Name="pictureBox" Width="300" Height="300" Paint="pictureBox_Paint" />
</WindowsFormsHost>
</Grid>
</Window>

C# coding:
using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Collections.Generic;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Documents;
using System.Windows.Markup;

namespace test_drag
{
public partial class Window1
{
Font font;
public Window1()
{
this.InitializeComponent();
font = new Font("Arial", 10);
// Insert code required on object creation below this point.

}
private void pictureBox_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.DrawString("This text is render", font, System.Drawing.Brushes.Red, 0, 0);

}



protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{

base.OnPaint(e);
e.Graphics.DrawString("this overrride", font, System.Drawing.Brushes.Blue, 5, 5);
}
}
}
GeneralOleDb Jet UpdateCommand Pin
jharker19876-Mar-08 15:30
jharker19876-Mar-08 15:30 
GeneralRe: OleDb Jet UpdateCommand Pin
PIEBALDconsult6-Mar-08 16:39
mvePIEBALDconsult6-Mar-08 16:39 
GeneralRe: OleDb Jet UpdateCommand Pin
jharker19877-Mar-08 1:11
jharker19877-Mar-08 1:11 
GeneralRe: OleDb Jet UpdateCommand Pin
PIEBALDconsult7-Mar-08 5:44
mvePIEBALDconsult7-Mar-08 5:44 
GeneralRe: OleDb Jet UpdateCommand Pin
KaptinKrunch6-Mar-08 16:46
KaptinKrunch6-Mar-08 16:46 
GeneralPump wait message while accessing data Pin
MAW306-Mar-08 15:14
MAW306-Mar-08 15:14 
GeneralRe: Pump wait message while accessing data Pin
KaptinKrunch6-Mar-08 16:50
KaptinKrunch6-Mar-08 16:50 
GeneralRe: Pump wait message while accessing data Pin
PIEBALDconsult6-Mar-08 17:31
mvePIEBALDconsult6-Mar-08 17:31 
QuestionHow can I create the following array? [modified] Pin
DIMITRIS OLGA6-Mar-08 11:48
DIMITRIS OLGA6-Mar-08 11:48 
GeneralRe: How can I create the following array? Pin
Christian Graus6-Mar-08 11:58
protectorChristian Graus6-Mar-08 11:58 
JokeRe: How can I create the following array? Pin
PIEBALDconsult6-Mar-08 12:16
mvePIEBALDconsult6-Mar-08 12:16 
GeneralRe: How can I create the following array? Pin
Anthony Mushrow6-Mar-08 13:11
professionalAnthony Mushrow6-Mar-08 13:11 
GeneralRe: How can I create the following array? Pin
Christian Graus6-Mar-08 13:31
protectorChristian Graus6-Mar-08 13:31 
Questionhow to move a control on mouse move event Pin
netJP12L6-Mar-08 10:30
netJP12L6-Mar-08 10:30 
AnswerRe: how to move a control on mouse move event Pin
Christian Graus6-Mar-08 11:59
protectorChristian Graus6-Mar-08 11:59 
GeneralRe: how to move a control on mouse move event Pin
netJP12L6-Mar-08 16:48
netJP12L6-Mar-08 16:48 
QuestionRichTextBox & SpellCheck [modified] Pin
W Balboos, GHB6-Mar-08 9:29
W Balboos, GHB6-Mar-08 9: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.