Jump to content

Project Templates for Visual Studio


Recommended Posts

When I use the "Effect" template, and I try to edit the ConfigDialog in the Windows Forms Designer, the designer behaves very upsettingly. I'm running Windows 10 and I'm using Visual Studio 2019.

 

Specifically, when I try to drag the resizing handles for the window, besides just resizing, the window jumps to God only knows where. In this screenshot, I began clicking and holding the button:

image.png.05bec0860cd7e44553d6fc49b107ac81.png

and the moment I dragged it a pixel to the right, the dialog widget jumped out of view, and I became unable to scroll the editor window far enough in any direction to see any of it. Then I tried closing and reopening the file, and now all I see is this where the dialog used to be:

image.png.d7b5d2ba7cf5220a104c04581b03c4a9.png

...and so on. In fact, changing many of the properties, through the GUI or through the editor panel in the corner of VS, causes similar distressing behavior. What I've shown you here is actually a lot worse than it was when I first noticed that there were problems: originally, resizing the dialog would only cause it to move rapidly down and to the right, but not so rapidly as to be gone in a single update like it is now.

 

At first I thought this was the fault of the Forms Designer itself, but I don't think so anymore. I started following this official tutorial to see if these problems would occur with a simpler project. When I made a new project using the built-in Windows Forms Control Library template as the tutorial told me, I encountered no such issues. Is there a problem with something in the project files? What gives?

Edited by Modus Ponens
Link to post
Share on other sites
20 minutes ago, Modus Ponens said:

At first I thought this was the fault of the Forms Designer itself, but I don't think so anymore. I started following this official tutorial to see if these problems would occur with a simpler project. When I made a new project using the built-in Windows Forms Control Library template as the tutorial told me, I encountered no such issues. Is there a problem with something in the project files? What gives?

 

You could have saved yourself a whole lot of time, if you had just read the previous posts in this topic.

Link to post
Share on other sites
On 12/23/2019 at 5:51 PM, NSD said:

I was curious to see if the issue by resizing the Form was fixed

 

On 8/20/2020 at 4:06 AM, Modus Ponens said:

and the moment I dragged it a pixel to the right, the dialog widget jumped out of view

 

This will be fixed in paint.net v4.2.14. You can install an alpha build from here:

https://forums.getpaint.net/topic/116972-paintnet-4214-alpha-build-7542/

  • Like 1
  • Upvote 4
Link to post
Share on other sites
  • 3 weeks later...

Great to see that the file types have been updated.

 

I've just been trying to compile the code with VS2017 targetting .NET 4.8. I have a couple of issues with SvgFileType.cs.

 

Firstly, the obsolete constructor. Have I fixed it correctly?

 

    public class SvgFileType : FileType
    {
        //
        // Obsolete.
        //
        //public SvgFileType()
        //    : base(
        //        "Scalable Vector Graphics",       // name
        //        FileTypeFlags.SupportsLoading,    // flags
        //        new[] {".svg", ".svgz"})          // extensions
        //{
        //}

        //
        // New and improved.
        //
        public SvgFileType()
            : base
            (
                "Scalable Vector Graphics",         // name
                new FileTypeOptions                 // options
                {
                    LoadExtensions = new string[] { ".svg", ".svgx" }
                }
            )
        {
            //this.Options.LoadExtensions = new List<string> { ".svg", ".svgx" };
            //this.Options.LoadExtensions = new string[] { ".svg", ".svgx" };
            //FileTypeOptions fto = new FileTypeOptions
            //{
            //    LoadExtensions = new List<string> { ".svg", ".svgx" }
            //};
        }

 

 

Secondly, I get 4 compile errors with SvgVisualElement.Visible being read only, e.g.:

 

Quote

Error    CS0200    Property or indexer 'SvgVisualElement.Visible' cannot be assigned to -- it is read only    SvgFileTypePlugin    C:\Users\me\Dowloads\Scalable-Vector-Graphics-Plugin-for-Paint.NET-0.3-alpha\Scalable-Vector-Graphics-Plugin-for-Paint.NET-0.3-alpha\SvgFileType\SvgFileType.cs

 

Would it be OK to comment these out. or is there a new equivalent?

Link to post
Share on other sites
3 hours ago, Tim! said:

Firstly, the obsolete constructor. Have I fixed it correctly?

 

That looks okay to me.

 

3 hours ago, Tim! said:

Secondly, I get 4 compile errors with SvgVisualElement.Visible being read only, e.g.:

 

Would it be OK to comment these out. or is there a new equivalent?

 

You have to ask the people developing the SVG plugin.

Link to post
Share on other sites
  • 4 weeks later...

I just want to mention that in Project Template - Effect the slider has a minimum value equal to 0 which leads to crash due to division by zero in the following line:

CurrentPixel = (y% amount1 == 0)? ...


Also, SubmenuName is Blur although I think it should be null to be easily found by the user.

The plugin below was created just to test some things. It doesn't do anything special, it just draws lines and a circle.

The color control is based on the control in the CodeLab source code and is quite similar.

h0G6rJh.png

Here is the source code:
http://www.mediafire.com/file/9f9gz612mmmlldu/VSpdnProject.zip/file
 

  • Upvote 1
Link to post
Share on other sites
1 hour ago, NSD said:

I just want to mention that in Project Template - Effect the slider has a minimum value equal to 0 which leads to crash due to division by zero in the following line:


CurrentPixel = (y% amount1 == 0)? ...


Also, SubmenuName is Blur although I think it should be null to be easily found by the user.

 

People aren't meant to run the example code, but if it bothers you, submit a Pull request on the Github project.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...