Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6119587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:34:14+00:00 2026-05-23T15:34:14+00:00

I am a bit new at C# and I have run into a string

  • 0

I am a bit new at C# and I have run into a string concatenation issue. I am hoping someone might be able to give me a hint and help me resolve this. I have searched Google extensively and have spent more than a week on this so any help/advice would be greatly appreciated.

I have created a custom PathEditor for a string property. The property basically allows the user to key in a file to use in the app. If the file typed in is correct, it shows in the property cell as it should. What I am trying to do is output to the property cell an error message if the file typed in does not exist – I check this in my file validator. Here is the string literal issue.

If I use:

return inputFile+"Error_";

this works OK and I get the outpur file123.txtError_ in the property grid cell.

If I use:

return "Error_"+inputFile;

I get only the inputFile without the literal “Error_”. Sot he property grid cell shows file123.txt in the property grid cell.

I have checked and inputFile is a string type. Any ideas as to why this is happening?

Also, is there any way to change to font, and/or, color of the message output? I tried to change the background of the property grid cell and I understand that this is not possible to do.

Thank you.
Z

More of the code:

[
Description("Enter or select the wave file. If no extension, or a non .wav extension, is specified, the default extension .wav will be added to the filename."),
GridCategory("Sound"),
Gui.Design.DisplayName ("Input Sound"),
PathEditor.OfdParamsAttribute("Wave files (*.wav)|*.wav", "Select Audio File"),
Editor(typeof(PathEditor), typeof(System.Drawing.Design.UITypeEditor))
]
public string InputWavefile
{
    get { return System.IO.Path.GetFileName(inputtWavefile); }
    set 
    {
        if (value != inputWavefile)  // inputWavefile has been changed
        {                           
            // validate the input stringg
             _inputWavefile = FileValidation.ValidateFile(value);

            // assign validated value
            inputWavefile = _inputWavefile;
       }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:34:15+00:00Added an answer on May 23, 2026 at 3:34 pm

    I’m guessing your filename looks something like this, C:\Folder\FileName.txt when you start out.

    In your FileValidation.ValidateFile() method you

    return "Error_" + InputFileName;
    

    it now looks like this: Error_C:\Folder\FileName.txt.
    So, when you run the line below,

    get { return System.IO.Path.GetFileName( _inputWavefile ); }
    

    it strips off the path and returns the filename only, FileName.txt.

    Even when the filename is not valid, you are still running System.IO.Path.GetFileName() on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My development team has run into a design issue. I'm hoping someone can help
I'm fairly new to WCF development and have run into a couple problems whilst
I've been experimenting quite a bit with my new macbook pro and have run
I'm a bit new to SQL and have trouble constructing a select statement. I
I am a bit new to reusable plugins for jquery. I have ran across
I am a bit new to the Devel::Cover module, but have found it very
I'm a new bit in Qt... I have a Qt GUI application (written by
I have a bit of code that looks like this: text = reg.Replace(text, new
Okay I have updated my code quite a bit. I am getting a new
I'm quite new to MediaWiki, and now I have a bit of a problem.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.