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

C#

 
SuggestionRe: Creating a struct dynamically Pin
Richard Deeming1-Aug-19 1:40
mveRichard Deeming1-Aug-19 1:40 
GeneralRe: Creating a struct dynamically Pin
BillWoodruff1-Aug-19 8:47
professionalBillWoodruff1-Aug-19 8:47 
QuestionError when i try to add my control to form1 Pin
_Q12_29-Jul-19 8:30
_Q12_29-Jul-19 8:30 
AnswerRe: Error when i try to add my control to form1 Pin
Richard Deeming29-Jul-19 9:10
mveRichard Deeming29-Jul-19 9:10 
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_29-Jul-19 10:10
_Q12_29-Jul-19 10:10 
GeneralRe: Error when i try to add my control to form1 Pin
Richard Deeming30-Jul-19 1:52
mveRichard Deeming30-Jul-19 1:52 
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_30-Jul-19 7:58
_Q12_30-Jul-19 7:58 
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_29-Jul-19 10:34
_Q12_29-Jul-19 10:34 
Are you sure the root is correct?
What i did: I created a new alb.jpg file into (your specified folder root):
"c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
and the code now checks if in 'DesignMode', then load the default alb.jpg image.
Else, is runtime and load the normal image.
here is my code:
public tab()
{
    InitializeComponent();
    //if (!DesignMode && File.Exists("google.png"))
    //{
    //    img = new Bitmap("google.png");
    //}
    string alb = @"c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\alb.jpg";
    if (DesignMode==true)
    {
        img = new Bitmap(alb);
    }
    else
    {
        img = new Bitmap("google.png");
    }
}


Image img;
Rectangle rect = new Rectangle(5, 5, 22, 22);

private void tab_Paint(object sender, PaintEventArgs e)
{
    e.Graphics.DrawImage(img, rect);
}

string mytext;
public string tab_Text
{
    get { return mytext; }
    set
    {
        label1.Text = mytext = value;
    }
}

I get the same error as the first time, not finding the png file.
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_29-Jul-19 22:10
_Q12_29-Jul-19 22:10 
AnswerRe: Error when i try to add my control to form1 Pin
Dave Kreskowiak29-Jul-19 9:16
mveDave Kreskowiak29-Jul-19 9:16 
QuestionUnauthorizedAccessException Access to the remote share path Pin
Member 1158435626-Jul-19 0:09
Member 1158435626-Jul-19 0:09 
AnswerRe: UnauthorizedAccessException Access to the remote share path Pin
#realJSOP26-Jul-19 0:44
mve#realJSOP26-Jul-19 0:44 
Questionc# app design Pin
Member 1454172825-Jul-19 13:31
Member 1454172825-Jul-19 13:31 
AnswerRe: c# app design Pin
Gerry Schmitz25-Jul-19 14:42
mveGerry Schmitz25-Jul-19 14:42 
AnswerRe: c# app design Pin
Mycroft Holmes25-Jul-19 14:43
professionalMycroft Holmes25-Jul-19 14:43 
GeneralRe: c# app design Pin
#realJSOP26-Jul-19 0:47
mve#realJSOP26-Jul-19 0:47 
GeneralRe: c# app design Pin
Mycroft Holmes26-Jul-19 11:52
professionalMycroft Holmes26-Jul-19 11:52 
GeneralRe: c# app design Pin
MSBassSinger30-Jul-19 7:33
professionalMSBassSinger30-Jul-19 7:33 
AnswerRe: c# app design Pin
BillWoodruff25-Jul-19 15:10
professionalBillWoodruff25-Jul-19 15:10 
GeneralRe: c# app design Pin
Richard Andrew x6427-Jul-19 3:21
professionalRichard Andrew x6427-Jul-19 3:21 
QuestionCrystel Report in Print Duplicate Page Print Pin
Member 1235167123-Jul-19 0:53
Member 1235167123-Jul-19 0:53 
RantRe: Crystel Report in Print Duplicate Page Print Pin
Richard Deeming23-Jul-19 1:00
mveRichard Deeming23-Jul-19 1:00 
AnswerRe: Crystel Report in Print Duplicate Page Print Pin
OriginalGriff23-Jul-19 4:01
mveOriginalGriff23-Jul-19 4:01 
AnswerRe: Crystel Report in Print Duplicate Page Print Pin
Gerry Schmitz24-Jul-19 6:22
mveGerry Schmitz24-Jul-19 6:22 
QuestionData type mismatch in update query Pin
Member 1326108423-Jul-19 0:07
Member 1326108423-Jul-19 0:07 

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.