Click here to Skip to main content
15,914,924 members
Home / Discussions / C#
   

C#

 
AnswerRe: Retrieve the data from Excel Sheet, manipulate the data and then I want to store it in data base Pin
Giorgi Dalakishvili20-Sep-09 3:18
mentorGiorgi Dalakishvili20-Sep-09 3:18 
QuestionHow do convert and object to binary? Pin
AndyASPVB20-Sep-09 1:07
AndyASPVB20-Sep-09 1:07 
AnswerRe: How do convert and object to binary? Pin
Eddy Vluggen20-Sep-09 1:26
professionalEddy Vluggen20-Sep-09 1:26 
GeneralRe: How do convert and object to binary? Pin
AndyASPVB20-Sep-09 1:44
AndyASPVB20-Sep-09 1:44 
GeneralRe: How do convert and object to binary? Pin
OriginalGriff20-Sep-09 2:49
mveOriginalGriff20-Sep-09 2:49 
GeneralRe: How do convert and object to binary? Pin
Eddy Vluggen20-Sep-09 3:08
professionalEddy Vluggen20-Sep-09 3:08 
GeneralRe: How do convert and object to binary? Pin
AndyASPVB20-Sep-09 3:32
AndyASPVB20-Sep-09 3:32 
GeneralRe: How do convert and object to binary? Pin
Eddy Vluggen20-Sep-09 3:54
professionalEddy Vluggen20-Sep-09 3:54 
Questioncannot convert from string to System.IntPtr Pin
steve_rm20-Sep-09 0:54
steve_rm20-Sep-09 0:54 
AnswerRe: cannot convert from string to System.IntPtr Pin
Dave Kreskowiak20-Sep-09 2:19
mveDave Kreskowiak20-Sep-09 2:19 
AnswerRe: cannot convert from string to System.IntPtr Pin
Luc Pattyn20-Sep-09 2:41
sitebuilderLuc Pattyn20-Sep-09 2:41 
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 

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.