Jump to content

C# Trackbar Ve Registry Ilişkisi


winvistafiko
 Share

Recommended Posts

Merhabalar öncelikle trackBar1.Value int değeri alabilir yani sayısal değerler olmalı siz ToString() ile yazı biçiminde çağırmaya çalışıyorsun VS de size hata veriyor sonucu;

trackBar1.Value = Convert.ToInt32(Registry.LocalMachine.OpenSubKey("xxx").GetValue("xxx"));

şeklinde yaparsınız çözmüş olursunuz.

 

Registry deki değer boş dönerse sayısal biçime çevirmede sıkıntı yapabilir try catch ile müdahale edilebilir yine;

            try
            {
                trackBar1.Value = Convert.ToInt32(Registry.LocalMachine.OpenSubKey("xxx").GetValue("xxx"));
            }
            catch
            {
                trackBar1.Value = 0; // Varsayılan değer ne olucaksa
            }

Kolay gelsin =)

Link to comment
Share on other sites

namespace WindowsFormsApplication14
{
    public partial class Form1 : Form
    {
        ToolTip tp = new ToolTip();

        public Form1()
        {
            InitializeComponent();

        }

        private void trackBar1_MouseEnter(object sender, EventArgs e)
        {
            //tp.ToolTipIcon = ToolTipIcon.Info;
            //tp.ToolTipTitle = "Trackbar Değeri";
            //tp.IsBalloon = true;
            tp.SetToolTip(trackBar1, trackBar1.Value.ToString());
        }
    }
}

yorum satırlarından // leri silersen görünümü özelleştirebilirsin.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...