It is currently January 29th, 2023, 7:17 pm

RainForms plugin

Share and get help with Plugins and Addons
User avatar
Posts: 1
Joined: October 16th, 2019, 1:15 pm

RainForms plugin

Post by SnGmng »

A plugin for Rainmeter that lets you use System.Windows.Forms dialogs within Rainmeter :D

You can see the source code of this plugin here:
And you can download a demo skin here:
To create a Form with RainForms you have to define a Measure of type "Form" first. You can look up which Properties you can set on the form You can set any property mentioned at the page. Here is an example:

Code: Select all

    [FormTest]           <-- name the measure like you want
    Plugin=RainForms     <-- specify RainForms as the Plugin
    Type=Form            <-- specify the type of the control. In this case we need a Form
    Text=TestForm        <-- you can specify som optional propertys if you want like the text of the form or the size
After you have created a Form measure, you can show the form through a bang. I will use the OnRefreshAction to show the form each time we load the skin:

Code: Select all

    OnRefreshAction=[!CommandMeasure FormTest Show]    <-- bang to show the form
    [MeterDummy]    <-- the skin wont load if there are no meters, so we make a dummy meter

If you run the skin you will notice that there will popup an empty Form:
But an empty form is not very useful. Lets add some label and button on there.

Code: Select all

    ParentName=FormTest      <-- specify the form measure on which the labe should appear
    Type=Label               <-- specify the type of the control. In this case we need a label
    Text=I'm a label. fml    <-- add some text to the label
    Location=10,10           <-- the location on the form: x and y coordinates
    AutoSize=1               <-- let the label size itself
    Font=Arial,20            <-- lets increase the font size a bit
    Text=Okay... bye
    ClientSize=200,100                           <-- size of the button (width, height)
    OnClick=[!CommandMeasure FormTest Close]     <-- if the button is clicked, close the form

And if we click the button, the form will close as expected. You can use many more controls than just a label for example a textbox, groupbox, checkbox, tabcontrol etc. , you can use any control in System.Windows.Forms:

Calling Methods
You can call any method through rainmeter bangs that is avaliable on the specific control. You can look up on msdn which methods are available.
Here are some examples:

Code: Select all

    [!CommandMeasure FormTest Show]
    [!CommandMeasure FormTest Close]
    [!CommandMeasure FormTest BringToFront]
    [!CommandMeasure SomeTexbox Focus]
    [!CommandMeasure TreeView Collapse]
You can set enums by writing the enum as a string. use "|" to seperate multiple enums

Code: Select all

    Anchor=Bottom|Left     <-- set the anchor point to the bottom left

RFTypeInfo and RFPropertyInfo
You can use a bang like this to optain information for a specific type or property:

Code: Select all

    [!CommandMeasure FormTest "RFTypeInfo System.Drawing.Size"]
    [!CommandMeasure FormTest "RFPropertyInfo Width"]
Thats it for now, i will add more documentation soon! :thumbup:
You do not have the required permissions to view the files attached to this post.
Last edited by eclectic-tech on December 24th, 2019, 12:54 pm, edited 1 time in total.
Reason: Changed links to the en-us versions of Microsoft pages.
User avatar
Posts: 251
Joined: May 12th, 2019, 8:55 am

Re: RainForms plugin

Post by Cariboudjan »

I have some questions about this plugin. I have a WinForms compiled .exe addon I use with Rainmeter that reserves screen area to accommodate a menu bar. The suite is called Droptop. It is an invisible window that snaps to to top portion of the screen.

Looking at your documentation I'm not sure if this would be possible to implement this same addon using the RainForms plugin. Please contact me at as I will probably not be re-checking this forum page often.