Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

C1AllenS

@C1AllenS
About
Posts
63
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to draw a line on a picture box
    C C1AllenS

    Hello, You can try the given code. BEGIN CODE Dim MD, MU As Point Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown MD = e.Location End Sub Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove If e.Button = Windows.Forms.MouseButtons.Left Then MU = e.Location DrawLine() End If End Sub Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp MU = e.Location DrawLine() End Sub Public Sub DrawLine() Dim g As Graphics g = Me.PictureBox1.CreateGraphics g.Clear(Me.PictureBox1.BackColor) g.DrawLine(Pens.Blue, MD, MU) g.Dispose() End Sub I hope this will help. Regards,

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic graphics help tutorial

  • Create database table directly from a dataset which has many no. of data table [modified]
    C C1AllenS

    Hello, So you basically wants to move the XML data into the SQL server. If you are trying to do this through code, then you can have a look at the given web link which should give you some fair idea on how to achieve this. http://www.dbazine.com/sql/sql-articles/cook2[^] Hope this will help. Regards,

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic help database xml

  • How to add New row datagridview with checkboxcell in all columns
    C C1AllenS

    Hello, this does not seem be possible. Conversion of boolean values to different datatypes may throw some errors while inserting values. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic css database json tutorial question

  • problem while trying to use form closing event [modified]
    C C1AllenS

    Hello Kisran, I am not sure whats wrong at your side. But your code works perfectly at my end. In case you are not able to resolve it, you can probably try this slight modified version of your code. BEGIN CODE Dim dr As DialogResult = MessageBox.Show("Do you wish to close the Form", "Closing Form", MessageBoxButtons.YesNo) If dr = Windows.Forms.DialogResult.Yes Then e.Cancel = False Else e.Cancel = True End If END CODE I hope this works. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic help

  • Databindings property for textbox control in Design mode - VS 2005 [modified]
    C C1AllenS

    Hello, First of all, you need to set the DataSource and DataMember for the BindingSource. Then you can use set the desired bindingSource.ColumnName in the Text property under DataBindings() in the Properties Windows(Located at the top on the window) of the TextBox. In the MoveNext and MovePrevious buttons, you can simply define the following code: BindingSource1.MovePrevious() or BindingSource1.MoveNext() For more information, you can visit the given link: http://www.codeproject.com/KB/grid/BindSourceBindingNavCS.aspx[^] I hope this will help. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic visual-studio design tutorial

  • AutoCompleteStringCollection
    C C1AllenS

    Hello, This will not be possible to implement. Reason being that the AutoCompleteSource only takes String collection and would sort the colection only in string format. Regards,

    Allen Smith ComponentOne LLC www.componentone.com

    C# csharp question

  • Opening files in fileListBox
    C C1AllenS

    Hello Annir, Have a look at the given web link which provides similar information. http://www.developerfusion.co.uk/show/278/ I hope this will assist you. Regards,

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic question linux help

  • Delete all rows from datagridview
    C C1AllenS

    Hello, Well if you do not want to select all rows and then delete, then you can implement that in Button Click or some menu selection. Use this code to delete all the rows. You will have to manually loop through the rows and delete them one by one. for (int i = this.dataGridView1.Rows.Count - 2; i > -1; i--) this.dataGridView1.Rows.RemoveAt(i); I hope this will help. Regards,

    Allen Smith ComponentOne LLC www.componentone.com

    C# question announcement

  • Print the information on a Windows Form
    C C1AllenS

    Hello Puneet, Take a look at the following web link. I believe this should help. http://www.csharpcorner.com/UploadFile/srajlaxmi/PrintingWindowsForm01182008021239AM/PrintingWindowsForm.aspx Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C# csharp tutorial

  • incrementing using C#.Net
    C C1AllenS

    Hello, If I understand correctly, you want that each time application is started, the value in the TextBox should be incremented for the last value that was used. Well if thats the case then you will have to store the value each time the application is closed and then read it back again into the text box and increment the value. I hope this helps.

    Allen Smith ComponentOne LLC www.componentone.com

    C# csharp help

  • panels
    C C1AllenS

    Hi, Well I am not able to find any such links, but probably you could try this given code which implements sliding of panels. The basic implementation includes decreasing or increasing the height of the panel on Timer tick. For example: We have a Panel, Timer and a Button control. On button control we are closing and opening the panel. BEGIN CODE bool close=false; private void timer1_Tick(object sender, EventArgs e) { if (close==false) { if (panel1.Height > 0) panel1.Height -= 10; else { timer1.Enabled = false; close = true; } } else { if (panel1.Height < 190) panel1.Height += 10; else { timer1.Enabled = false; close = false; } } } private void button1_Click(object sender, EventArgs e) { timer1.Enabled = true; } END CODE I hope this will help. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C#

  • Image Path From Image List
    C C1AllenS

    Hi, ImageList is only used to store images. It does not have the option to return the actual path of the images. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C#

  • How to create new property (cols,Rows) to DataGridView [modified]
    C C1AllenS

    Hello Hai, You will have to create a new UserControl inheriting your application from the DataGridView. Then you can define new Properties for the control. Inherited NameSpace will be System.Windows.Forms.DataGridView. Hope this helps. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic design tutorial question

  • MDI form in vb.net 2.0
    C C1AllenS

    Hello Vijay, Define a variable in child form of type MDIForm. Dim _mrm As MainForm Now define a function in Child form which takes an argument of type MDIForm. For example: Public Sub parentmin(ByVal mainform As MainForm) _mrm = mainform Me.Show() End Sub Set the following code in the LostFocus() event of the childform Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus _mrm.Focus() _mrm.WindowState = FormWindowState.Minimized End Sub Now From MDIForm, you should call the Child form in the following manner(Lets say on menu button click): Dim frm As New Form1 frm.parentmin(Me) I believe this should help. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic csharp help question

  • Get value from child to parent window
    C C1AllenS

    Hello, You can try the given solution. Lets say we have two forms Form1 and Form2. In form2 we define a function which takes the Form1 as argument. Form1 _frm; Public Sub ShowForm(ByVal frm As Form1, ByVal img As Image) _frm = frm Me.Show() End Sub Lets say we will return a value of type integer to Form1. For that we will have to define an integer variable in Form1 and a Property for that variable to set its value. Dim _val As Integer Property Val() As Integer Get Return _val End Get Set(ByVal value As Integer) _val = value End Set End Property On Button Click in Form 1 we will open the Form2 in the following manner: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As New Form2 frm.ShowForm(Me) End Sub Now in FormClosing of Form2, we will set the value. Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing _frm.Val = 2 End Sub I hope this helps. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    Visual Basic

  • Format BoundColumn Text
    C C1AllenS

    Hello, Could you explain your requirement on how and when you wish to pass the value to your method. Is there any specific action after you wish to pass the data. The normal procedure to pass the data could be in either of the given forms. For example: private void button1_Click(object sender, EventArgs e) { //mymethod(this.dataGridView1.CurrentCell.Value); int row, col; row = 3; col = 2; mymethod(this.dataGridView1[col, row].Value); } public void mymethod(Object obj) { MessageBox.Show(obj.ToString()); } I hope this helps. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C# question

  • inserting float value in sql from c#
    C C1AllenS

    Hello Ashok, If I get it correctly, you wish to retrieve a value from a string variable containing a floating value. If thats the case, you can try this. String str = "123.32"; float f = float.Parse(str); I hope this helps. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C# csharp database tutorial

  • Dragable rectangles
    C C1AllenS

    Hello, There is no other way apart from this to draw rectangles. However, the only problem was the calculation part which was working only when you draw from lefttop to right bottom. However, while doing vice versa, the height and width was getting negative values. Try this piece of code in MouseUp event()

        private void Form1\_MouseUp(object sender, MouseEventArgs mouseEv)
        {
    
            textBox2.Text = Convert.ToString(mouseEv.Location);
    
            Graphics graphics = this.CreateGraphics();
            Rectangle rectangle;            
    
            if (mouseEv.Y > mouseDownY)
            {
                height = mouseEv.Y - mouseDownY;
            }
            else
                height =  mouseDownY - mouseEv.Y;
            
            if (mouseEv.X < mouseDownX)
            {
                width = mouseDownX - mouseEv.X;
                
                rectangle = new Rectangle(mouseEv.X, mouseEv.Y, width, height);
            }
            else
            {
                width = mouseEv.X - mouseDownX;
                rectangle = new Rectangle(mouseDownX, mouseDownY, width, height);
            }
    
            graphics.DrawRectangle(Pens.Red, rectangle);
                        
        }
    

    I believe this should resolve your issue. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C# question com graphics tools

  • read file from bottom
    C C1AllenS

    Hello Vineesh, Trh using the given code snippet. You need to import the namespace System.IO. using System.IO; BEGIN CODE StreamReader sr = new StreamReader("C:\\Test.txt"); String str; str = sr.ReadToEnd(); int index= str.LastIndexOf("exit 1"); TextBox1.Text=str.Substring(0,index); END CODE I hope this will meet your requirement. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C# help question

  • In Key-Value Pairs , keys need not be unique , which Collection to use?
    C C1AllenS

    Hello Ashish, Try using the GUID structure for the same. You may refer to the given web link for more assistance with generating GUID keys. http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=335 http://www.csharphelp.com/archives/archive188.html I hope this will help. Regards, Allen

    Allen Smith ComponentOne LLC www.componentone.com

    C# csharp question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups