Click here to Skip to main content
15,881,757 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to check a field/property is existing in Win32_DiskDrive ? Pin
Simon_Whale1-Apr-14 1:18
Simon_Whale1-Apr-14 1:18 
GeneralRe: How to check a field/property is existing in Win32_DiskDrive ? Pin
taibc1-Apr-14 15:47
taibc1-Apr-14 15:47 
AnswerRe: How to check a field/property is existing in Win32_DiskDrive ? Pin
Wayne Gaylard1-Apr-14 1:21
professionalWayne Gaylard1-Apr-14 1:21 
GeneralRe: How to check a field/property is existing in Win32_DiskDrive ? Pin
taibc1-Apr-14 15:47
taibc1-Apr-14 15:47 
GeneralRe: How to check a field/property is existing in Win32_DiskDrive ? Pin
Simon_Whale1-Apr-14 22:40
Simon_Whale1-Apr-14 22:40 
GeneralRe: How to check a field/property is existing in Win32_DiskDrive ? Pin
taibc2-Apr-14 17:59
taibc2-Apr-14 17:59 
Questionhow i can remove the current row..? the record is not yet saved on the database..the remove button is exist in every row of a repeater.. Pin
Member 1058077031-Mar-14 23:14
Member 1058077031-Mar-14 23:14 
QuestionC# new tab dynamic Pin
antrock10131-Mar-14 23:09
antrock10131-Mar-14 23:09 
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;
using System.IO;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Threading;

namespace putty
{
    public partial class Form1 : Form
    {

        public int tabp = 0;
        public Panel panel;
        public string select;
        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);

        [DllImport("user32.dll", SetLastError = true)]
        static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

        public Form1()
        {
            
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            //string folder = connections\\";
            string[] files = Directory.GetFiles("connections\\", "*.bat");

            listBox1.Items.AddRange(files);
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            txtbatch.Clear();
            txtbatch.Text += "C:/plink.exe -v -ssh " + txtusr.Text + "@" + txtip.Text + " -pw " + txtpass.Text;
            File.WriteAllText(@"connections\\" +txtname.Text+".bat", txtbatch.Text);
            MessageBox.Show("Please Refresh");
        }




        public void button1_Click(object sender, EventArgs e)
        {
            TabPage page = new TabPage(); //create our IContainer/TabPage
            Panel panel= new Panel(); //create our button
            panel.Dock = DockStyle.Fill; //make our button fill up the tab page when added
          //  button.Click += new EventHandler(button_Click); //this adds the below button_Click event
          
            tabControl1.TabPages.Add(page); //add our tab page to the tab control
            tabControl1.SelectedTab = page; //make our tab the selected tab


            cmd(panel); // run the cmd start up
        }


        public void cmd(Panel panel)
        {
            select = listBox1.Text;

            const int WM_SYSCOMMAND = 0x112;
            const int SC_MINIMIZE = 0xF020;
            const int SC_MAXIMIZE = 0xF030;

            Process p = Process.Start(
                       new ProcessStartInfo()
                       {
                           FileName = select, //runs the file selected in cmd
                           WindowStyle = ProcessWindowStyle.Minimized
                       });
            Thread.Sleep(500);
            IntPtr value = SetParent(p.MainWindowHandle, panel.Handle); // cant find panel
            SendMessage(p.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
        }

    }
}


modified 1-Apr-14 6:59am.

AnswerRe: C# new tab dynamic Pin
Richard MacCutchan31-Mar-14 23:30
mveRichard MacCutchan31-Mar-14 23:30 
GeneralRe: C# new tab dynamic Pin
antrock1011-Apr-14 0:02
antrock1011-Apr-14 0:02 
GeneralRe: C# new tab dynamic Pin
Richard MacCutchan1-Apr-14 0:28
mveRichard MacCutchan1-Apr-14 0:28 
GeneralRe: C# new tab dynamic Pin
antrock1011-Apr-14 2:03
antrock1011-Apr-14 2:03 
GeneralRe: C# new tab dynamic Pin
antrock1011-Apr-14 2:37
antrock1011-Apr-14 2:37 
GeneralRe: C# new tab dynamic Pin
Eddy Vluggen1-Apr-14 5:02
professionalEddy Vluggen1-Apr-14 5:02 
GeneralRe: C# new tab dynamic Pin
Richard MacCutchan1-Apr-14 6:37
mveRichard MacCutchan1-Apr-14 6:37 
QuestionHow to Mark different shapes on Image in asp.net web application Pin
codeprojmar201331-Mar-14 20:50
codeprojmar201331-Mar-14 20:50 
AnswerRe: How to Mark different shapes on Image in asp.net web application Pin
OriginalGriff31-Mar-14 21:39
mveOriginalGriff31-Mar-14 21:39 
AnswerRe: How to Mark different shapes on Image in asp.net web application Pin
Pete O'Hanlon31-Mar-14 21:44
mvePete O'Hanlon31-Mar-14 21:44 
GeneralRe: How to Mark different shapes on Image in asp.net web application Pin
OriginalGriff31-Mar-14 23:21
mveOriginalGriff31-Mar-14 23:21 
SuggestionRe: How to Mark different shapes on Image in asp.net web application Pin
Richard MacCutchan31-Mar-14 21:47
mveRichard MacCutchan31-Mar-14 21:47 
QuestionRepeater Control Pin
Member 1058077031-Mar-14 20:26
Member 1058077031-Mar-14 20:26 
AnswerRe: Repeater Control Pin
Tom Marvolo Riddle31-Mar-14 21:45
professionalTom Marvolo Riddle31-Mar-14 21:45 
QuestionWindows or WPF? Pin
Shady George31-Mar-14 17:23
Shady George31-Mar-14 17:23 
AnswerRe: Windows or WPF? Pin
Peter Leow31-Mar-14 17:47
professionalPeter Leow31-Mar-14 17:47 
GeneralRe: Windows or WPF? Pin
Shady George31-Mar-14 18:14
Shady George31-Mar-14 18:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.