I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
If you want to show your windows form application in NotifyIcon toolBar then you can use this example. When you press minimize button of windows form then your application should minimized in system tray.
Try these steps to minimized your application as System Tray:
Step-1 : Add a new windows form into your project
Step-2 : Add a NotifyIcon control in currently added form.
Step-3 : Select Show smart tag, add icon file in NotifyIcon control.
Step-4 : Add the following code in code file with respective events
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void Form3_Resize(object sender, EventArgs e)
{
if (WindowState==FormWindowState.Minimized)
{
ShowIcon = false;
notifyIcon1.Visible = true;
notifyIcon1.ShowBalloonTip(1000);
}
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
ShowInTaskbar = true;
notifyIcon1.Visible = false;
WindowState = FormWindowState.Normal;
}
private void Form3_Load(object sender, EventArgs e)
{
notifyIcon1.BalloonTipText = "Application minimized";
notifyIcon1.BalloonTipTitle = "dotprogramming.blogspot.com";
}
}
}
Code generates the following output
Comments
Post a Comment