Click here to Skip to main content
11,642,402 members (64,500 online)
   

C#

 
GeneralRe: Cannot Access the form _ Cross-thread operation Pin
mohammadkaab21-Jan-13 20:26
membermohammadkaab21-Jan-13 20:26 
Questionwcf p2p file transfering over internet Pin
vab26108519-Jan-13 2:03
membervab26108519-Jan-13 2:03 
QuestionWorking with tab escape charecter Pin
Mc_Topaz19-Jan-13 1:49
memberMc_Topaz19-Jan-13 1:49 
AnswerRe: Working with tab escape charecter Pin
Abhinav S19-Jan-13 2:38
mvpAbhinav S19-Jan-13 2:38 
GeneralRe: Working with tab escape charecter Pin
Mc_Topaz19-Jan-13 3:22
memberMc_Topaz19-Jan-13 3:22 
QuestionDesign-Time Error in the Windows Forms Designer Pin
_q12_18-Jan-13 4:25
member_q12_18-Jan-13 4:25 
AnswerRe: Design-Time Error in the Windows Forms Designer Pin
Eddy Vluggen18-Jan-13 5:02
mvpEddy Vluggen18-Jan-13 5:02 
AnswerRe: Design-Time Error in the Windows Forms Designer Pin
Alan N18-Jan-13 5:42
memberAlan N18-Jan-13 5:42 
It's because the StartupPath is not what you think it is. Testing this on my system causes the designer view of the form to show an error message in HTML, helpfully rendered as one very long line. Carefully scrolling through it reveals that it looking for the image
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\pic.jpg

In a simplified test I place the image directly onto an otherwise empty user control. I thought that the correct thing to do would be to stop the designer attempting to load the image like this:
public partial class ImageControl : UserControl {
  String path;
  public ImageControl() {
    InitializeComponent();
    path = Application.StartupPath;
  }
 
  private void ImageControl_Load(object sender, EventArgs e) {
    if (!DesignMode) {
      BackgroundImage = Bitmap.FromFile(Path.Combine(path, "pic.jpg"));
    }
  }
}

Job done you might think, but no, as this allows the form to render properly with the image displayed. So what is going on? Actually I don't know, but the only reasonable explanation is that the designer loads the form more than once, in DesignMode where the path is incorrect and at least once more, not in DesignMode, where the path is correct.
QuestionParalel QuickSort with 2 threads running at the same spped Pin
George Nistor18-Jan-13 0:51
memberGeorge Nistor18-Jan-13 0:51 
AnswerRe: Paralel QuickSort with 2 threads running at the same spped Pin
Dave Kreskowiak18-Jan-13 4:20
mvpDave Kreskowiak18-Jan-13 4:20 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
George Nistor18-Jan-13 4:41
memberGeorge Nistor18-Jan-13 4:41 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
Dave Kreskowiak18-Jan-13 6:25
mvpDave Kreskowiak18-Jan-13 6:25 
AnswerRe: Paralel QuickSort with 2 threads running at the same spped Pin
Alan Balkany18-Jan-13 5:12
memberAlan Balkany18-Jan-13 5:12 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
George Nistor18-Jan-13 5:31
memberGeorge Nistor18-Jan-13 5:31 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
Dave Kreskowiak18-Jan-13 6:26
mvpDave Kreskowiak18-Jan-13 6:26 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
George Nistor18-Jan-13 6:53
memberGeorge Nistor18-Jan-13 6:53 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
Dave Kreskowiak18-Jan-13 7:31
mvpDave Kreskowiak18-Jan-13 7:31 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
George Nistor18-Jan-13 7:38
memberGeorge Nistor18-Jan-13 7:38 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
George Nistor18-Jan-13 22:49
memberGeorge Nistor18-Jan-13 22:49 
GeneralRe: Paralel QuickSort with 2 threads running at the same spped Pin
Dave Kreskowiak19-Jan-13 3:27
mvpDave Kreskowiak19-Jan-13 3:27 
QuestionDataSet to Dictionary Join? Pin
RickSharp17-Jan-13 12:25
memberRickSharp17-Jan-13 12:25 
GeneralRe: DataSet to Dictionary Join? Pin
PIEBALDconsult17-Jan-13 12:34
memberPIEBALDconsult17-Jan-13 12:34 
GeneralRe: DataSet to Dictionary Join? Pin
RickSharp17-Jan-13 12:51
memberRickSharp17-Jan-13 12:51 
GeneralRe: DataSet to Dictionary Join? Pin
PIEBALDconsult17-Jan-13 13:03
memberPIEBALDconsult17-Jan-13 13:03 
GeneralRe: DataSet to Dictionary Join? Pin
RickSharp17-Jan-13 13:13
memberRickSharp17-Jan-13 13:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150731.1 | Last Updated 2 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid