Click here to Skip to main content
15,886,258 members
Home / Discussions / C#
   

C#

 
QuestionHow to start working on Crystal Report? Pin
CoderForEver19-Sep-09 23:48
CoderForEver19-Sep-09 23:48 
AnswerRe: How to start working on Crystal Report? Pin
Nagy Vilmos20-Sep-09 0:34
professionalNagy Vilmos20-Sep-09 0:34 
GeneralRe: How to start working on Crystal Report? Pin
CoderForEver20-Sep-09 0:47
CoderForEver20-Sep-09 0:47 
GeneralRe: How to start working on Crystal Report? Pin
Nagy Vilmos20-Sep-09 0:52
professionalNagy Vilmos20-Sep-09 0:52 
QuestionQuestion about AutoResetEvent Pin
Xmen Real 19-Sep-09 22:37
professional Xmen Real 19-Sep-09 22:37 
AnswerRe: Question about AutoResetEvent Pin
Nicholas Butler20-Sep-09 0:42
sitebuilderNicholas Butler20-Sep-09 0:42 
GeneralRe: Question about AutoResetEvent Pin
Xmen Real 20-Sep-09 6:45
professional Xmen Real 20-Sep-09 6:45 
QuestionTransparency on moving controls? Pin
Sindicoro19-Sep-09 20:09
Sindicoro19-Sep-09 20:09 
The card image has rounded corners instead of square ones. When you drag it around the form it gets the correct transparency in the direction of travel but the direction you came from gets that really cool "whatever was on drawn over me last" effect. I know that the issue is that the pixels behind the control were never drawn to begin with, so there's no data for the transparency. Anyone know of a solution to it?

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        SetStyle(ControlStyles.AllPaintingInWmPaint, true);
        SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        try
        {
            Card cTest = new Card();
            cTest.Location = new Point(5, 5);
            cTest.CardFace = Properties.Resources.AceClub;
            Controls.Add(cTest);

            Card cTest2 = new Card();
            cTest2.Location = new Point(50, 5);
            cTest2.CardFace = Properties.Resources.AceClub;
            Controls.Add(cTest2);
        }
        catch (Exception Ex)
        {
            MessageBox.Show(Ex.Message);
        }
    }
}


public partial class Card : UserControl
{
    Bitmap _CardFace;
    Boolean _bMouseDown = false;
    Point _pMouse;

    public Bitmap CardFace
    {
        get { return _CardFace; }
        set
        {
            _CardFace = value;
            Width = _CardFace.Width;
            Height = _CardFace.Height;
        }
    }

    public Card()
    {
        InitializeComponent();
        SetStyle(ControlStyles.SupportsTransparentBackColor, true);
        SetStyle(ControlStyles.Opaque, true);
        BackColor = Color.Transparent;
    }

    protected override void OnPaint(PaintEventArgs e)
    {
        Graphics gGraphics = e.Graphics;
        gGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
        gGraphics.DrawImage(CardFace, new Point(0, 0));
    }

    protected override void OnPaintBackground(PaintEventArgs e)
    {
        //base.OnPaintBackground(e);
    }

    protected override void OnMouseDown(MouseEventArgs e)
    {
        _bMouseDown = true;
        _pMouse = e.Location;
        BringToFront();
    }

    protected override void OnMouseUp(MouseEventArgs e)
    {
        _bMouseDown = false;
    }

    protected override void OnMouseMove(MouseEventArgs e)
    {
        if (Capture && _bMouseDown)
        {
            Point P2CP = Parent.PointToClient(Cursor.Position);
            Location = new Point(P2CP.X - _pMouse.X, P2CP.Y - _pMouse.Y);
        }
    }
}

AnswerRe: Transparency on moving controls? Pin
Henry Minute19-Sep-09 20:57
Henry Minute19-Sep-09 20:57 
QuestionHelp with passing an array to a method Pin
Ceceily19-Sep-09 18:01
Ceceily19-Sep-09 18:01 
AnswerRe: Help with passing an array to a method Pin
Luc Pattyn19-Sep-09 18:13
sitebuilderLuc Pattyn19-Sep-09 18:13 
GeneralRe: Help with passing an array to a method Pin
Ceceily19-Sep-09 18:32
Ceceily19-Sep-09 18:32 
GeneralRe: Help with passing an array to a method Pin
Ceceily19-Sep-09 19:18
Ceceily19-Sep-09 19:18 
Questionretreiving values from datatable Pin
Rabia_Arif19-Sep-09 17:53
Rabia_Arif19-Sep-09 17:53 
AnswerRe: retreiving values from datatable Pin
Henry Minute19-Sep-09 21:15
Henry Minute19-Sep-09 21:15 
GeneralRe: retreiving values from datatable Pin
Rabia_Arif21-Sep-09 21:09
Rabia_Arif21-Sep-09 21:09 
AnswerRe: retreiving values from datatable Pin
Patrik.karlin20-Sep-09 0:42
Patrik.karlin20-Sep-09 0:42 
Questionhow to printpriview the datagridview data in c# Pin
Ramesh Reddy1111119-Sep-09 16:57
Ramesh Reddy1111119-Sep-09 16:57 
AnswerRe: how to printpriview the datagridview data in c# Pin
Christian Graus19-Sep-09 17:04
protectorChristian Graus19-Sep-09 17:04 
QuestionC# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
jasonandrew19-Sep-09 14:08
jasonandrew19-Sep-09 14:08 
AnswerRe: C# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
73amit17-Sep-10 0:45
73amit17-Sep-10 0:45 
AnswerRe: C# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
AshokNaik10-Jul-11 21:45
AshokNaik10-Jul-11 21:45 
QuestionRe: C# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
Member 110410579-Mar-15 0:50
Member 110410579-Mar-15 0:50 
QuestionImage position in other image c# ? [modified] Pin
sodevrom19-Sep-09 12:29
sodevrom19-Sep-09 12:29 
AnswerRe: Image position in other image c# ? Pin
Dave Kreskowiak19-Sep-09 14:01
mveDave Kreskowiak19-Sep-09 14:01 

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.