I have a Windows console application in C# that acts as a phone book. I'm getting a Missing Directives error in the lines where the application is setting up the menu icons, such as this one:
cmsProgramMenu.Items.Add("&Settings", Properties.Resources.phone_receiver.ToBitmap(), OnSettings_Click);
The full error is 'object' does not contain a definition for 'ToBitmap' and no extension method 'ToBitmap' accepting a first argument of type 'object' could be found (are you missing a using directive or assembly reference?)
.
I've poked around online and on SO and all the directives that I've seen suggested are already included in my code, but the error persists. These are the ones that I have:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
using System.Data;
using System.Windows.Media.Imaging;
Is there another one that I'm missing? Or is there another way of converting the images to Bitmap? I'm working in Visual Studio 2015.