-
Crashin DOTNET.
I'm still into this C# learning curve.
But a simple property set (see below) dumps my application.
Please excust the bracket layout - it didnt paste too well.
Oh... and does anyone else have the same problem with the itemData
property of a toolbar disappearing... ?
Am I doing anything wrong.... or does public beta 1 still too beta ?
//----------------------------
// CALLING FUNCTION FROM FORM
//----------------------------
namespace SearchPlus
protected void tbrMain_ButtonClick (object sender,
System.WinForms.ToolBarButtonClickEventArgs e) {
clsFolders xxx;
if (e.button.Text.ToString() == "Next") {
MessageBox.Show ("BOTTON: " + e.button.Text);
xxx = new clsFolders();
xxx.RootFolder = "C:"; // FALLS ON THIS CALL (SEE BELOW)
xxx.Go();
}
}
//----------------------------
// CALLED CLASS
//----------------------------
namespace SearchPlus
{
using System;
using System.IO;
using System.WinForms;
/// <summary>
/// Summary description for clsFolders.
/// </summary>
public class clsFolders
{
//private System.IO.Directory[] aaa;
//aaa. System.IO.Directory.GetDirectoriesInDirectory("C:", "*.*");
public clsFolders() {
//
// TODO: Add Constructor Logic here
//
RootFolder = "";
}
public void Go() {
MessageBox.Show(RootFolder.ToString());
}
public string RootFolder {
get { return RootFolder; }
set {
RootFolder = value; // STACK OVERFLOW OCCURS HERE
}
}
}
}
-
Re: Crashin DOTNET.
Ok - I fixed it.
You need to store the property as a local variable to the class.
Dont just use the property name.
"Murray Foxcroft" <murrayf@ebit.co.za> wrote in message
news:3adffe5b@news.devx.com...
> I'm still into this C# learning curve.
> But a simple property set (see below) dumps my application.
> Please excust the bracket layout - it didnt paste too well.
>
> Oh... and does anyone else have the same problem with the itemData
> property of a toolbar disappearing... ?
>
> Am I doing anything wrong.... or does public beta 1 still too beta ?
>
> //----------------------------
> // CALLING FUNCTION FROM FORM
> //----------------------------
> namespace SearchPlus
>
> protected void tbrMain_ButtonClick (object sender,
> System.WinForms.ToolBarButtonClickEventArgs e) {
>
> clsFolders xxx;
>
> if (e.button.Text.ToString() == "Next") {
> MessageBox.Show ("BOTTON: " + e.button.Text);
> xxx = new clsFolders();
> xxx.RootFolder = "C:"; // FALLS ON THIS CALL (SEE BELOW)
> xxx.Go();
> }
> }
>
> //----------------------------
> // CALLED CLASS
> //----------------------------
> namespace SearchPlus
> {
> using System;
> using System.IO;
> using System.WinForms;
>
> /// <summary>
> /// Summary description for clsFolders.
> /// </summary>
> public class clsFolders
> {
> //private System.IO.Directory[] aaa;
> //aaa. System.IO.Directory.GetDirectoriesInDirectory("C:", "*.*");
>
>
> public clsFolders() {
> //
> // TODO: Add Constructor Logic here
> //
> RootFolder = "";
> }
>
> public void Go() {
> MessageBox.Show(RootFolder.ToString());
>
> }
>
> public string RootFolder {
> get { return RootFolder; }
> set {
> RootFolder = value; // STACK OVERFLOW OCCURS HERE
> }
> }
> }
> }
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks