Click here to Skip to main content
15,917,928 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow do I programmatically add data to a report - and how do I draw the report? Pin
BluesEnd22-Aug-09 17:35
BluesEnd22-Aug-09 17:35 
AnswerRe: How do I programmatically add data to a report - and how do I draw the report? Pin
Mycroft Holmes22-Aug-09 18:15
professionalMycroft Holmes22-Aug-09 18:15 
GeneralRe: How do I programmatically add data to a report - and how do I draw the report? Pin
BluesEnd23-Aug-09 3:09
BluesEnd23-Aug-09 3:09 
GeneralRe: How do I programmatically add data to a report - and how do I draw the report? Pin
Mycroft Holmes23-Aug-09 14:13
professionalMycroft Holmes23-Aug-09 14:13 
QuestionGet Picture if background is transparent Pin
Anubhava Dimri21-Aug-09 21:51
Anubhava Dimri21-Aug-09 21:51 
AnswerRe: Get Picture if background is transparent Pin
Eddy Vluggen22-Aug-09 2:17
professionalEddy Vluggen22-Aug-09 2:17 
GeneralRe: Get Picture if background is transparent Pin
Anubhava Dimri22-Aug-09 2:45
Anubhava Dimri22-Aug-09 2:45 
GeneralRe: Get Picture if background is transparent Pin
Eddy Vluggen22-Aug-09 3:22
professionalEddy Vluggen22-Aug-09 3:22 
Add this to the OnPaint handler of your PictureBox;
public Form1()
{
    InitializeComponent();

    foreach (Control ctl in this.Controls)
        if (ctl is Label)
        {
            // This hides the labels during runtime
            Label lbl = (Label)ctl;
            lbl.Visible = false;
        }
}

private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
    foreach (Control ctl in this.Controls)
        if (ctl is Label)
        {
            // This lets the PictureBox draw the contents of the labels
            // on it's own canvas, as opposed to directly showing them.
            Label lbl = (Label)ctl;
            e.Graphics.DrawString(
                 lbl.Text,
                 lbl.Font,
                 new SolidBrush(lbl.ForeColor),
                 lbl.Left - pictureBox1.Left,
                 lbl.Top - pictureBox1.Top);
        }
}


eg_Anubhava wrote:
So Please give me another idea.


This hides the labels during runtime, and uses the Paint-handler to write the text onto the forms' canvas Smile | :)

eg_Anubhava wrote:
but my requirement is changing and Draging of Picturebox.


The PictureBox itself, or the controls inside it? The Panel that I referred to also has support for drag & drop.

Good luck Smile | :)

"Sometimes glass glitters more than diamonds because it has more to prove"

--Terry Pratchett

GeneralRe: Get Picture if background is transparent Pin
Anubhava Dimri23-Aug-09 18:54
Anubhava Dimri23-Aug-09 18:54 
GeneralRe: Get Picture if background is transparent Pin
Eddy Vluggen23-Aug-09 21:06
professionalEddy Vluggen23-Aug-09 21:06 
QuestionCheck box Error Message Pin
Bob Beaubien21-Aug-09 16:51
Bob Beaubien21-Aug-09 16:51 
AnswerRe: Check box Error Message Pin
Mycroft Holmes21-Aug-09 17:38
professionalMycroft Holmes21-Aug-09 17:38 
GeneralRe: Check box Error Message Pin
Bob Beaubien22-Aug-09 3:28
Bob Beaubien22-Aug-09 3:28 
GeneralRe: Check box Error Message Pin
Bob Beaubien22-Aug-09 6:04
Bob Beaubien22-Aug-09 6:04 
Questionrelative positioning of objects on forms Pin
tolmega0121-Aug-09 11:42
tolmega0121-Aug-09 11:42 
AnswerRe: relative positioning of objects on forms Pin
Henry Minute21-Aug-09 12:41
Henry Minute21-Aug-09 12:41 
AnswerRe: relative positioning of objects on forms Pin
Mycroft Holmes21-Aug-09 17:27
professionalMycroft Holmes21-Aug-09 17:27 
Questionhow can I load a word document into a form? Pin
waner michaud21-Aug-09 7:37
waner michaud21-Aug-09 7:37 
AnswerRe: how can I load a word document into a form? Pin
Mycroft Holmes21-Aug-09 17:31
professionalMycroft Holmes21-Aug-09 17:31 
QuestionRestoring mySQL database via VB net application problem Pin
558 jakobsson21-Aug-09 5:54
558 jakobsson21-Aug-09 5:54 
AnswerRe: Restoring mySQL database via VB net application problem/SOLVED Pin
558 jakobsson22-Aug-09 2:09
558 jakobsson22-Aug-09 2:09 
QuestionHow to Get the Source Path Pin
Anubhava Dimri21-Aug-09 2:01
Anubhava Dimri21-Aug-09 2:01 
AnswerRe: How to Get the Source Path Pin
DidiKunz21-Aug-09 2:19
DidiKunz21-Aug-09 2:19 
GeneralRe: How to Get the Source Path Pin
Anubhava Dimri21-Aug-09 18:13
Anubhava Dimri21-Aug-09 18:13 
AnswerRe: How to Get the Source Path Pin
Tom Deketelaere21-Aug-09 3:26
professionalTom Deketelaere21-Aug-09 3:26 

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.