Posts
 
Reputation
Joined
Last Seen
Ranked #86
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
94% Quality Score
Upvotes Received
339
Posts with Upvotes
312
Upvoting Members
135
Downvotes Received
22
Posts with Downvotes
20
Downvoting Members
13
113 Commented Posts
~899.09K People Reached
About Me

... I only want to learn programming decently!
That`s about it.

Interests
tennis, football, skiing, karting
Favorite Tags

1,469 Posted Topics

Member Avatar for Matthew N.

Use this: Imports System.Runtime.InteropServices Imports System.Text Namespace Ini ''' <summary> ''' Create a New INI file to store or load data ''' </summary> Public Class IniFile Public path As String <DllImport("kernel32")> _ Private Shared Function WritePrivateProfileString(section As String, key As String, val As String, filePath As String) As Long End …

Member Avatar for jehernandez757
0
3K
Member Avatar for Fiascor

back to topic question: [CODE] //constructor: public Form1() { this.button1.Visible = false; } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (this.checkBox1.Checked) this.button1.Visible = true; else this.button1.Visible = false; } [/CODE]

Member Avatar for JamesCherrill
0
1K
Member Avatar for RudolfRyan

Is your DGV bind to dataSource? If so you can do a filter with "SUM Columns", which will ack like an sql query. If you dont use any dataSource, you can loop through rows and sum cell in this partiucular column, like: [CODE] decimal total = 0; foreach (DataGridViewRow row …

Member Avatar for puppynp
0
2K
Member Avatar for Z33shan

YOu have to be aware of one thing: when you close the form (main form you named it), which has been started from Program class with: Application.Run(new Form1()); The application will close. To avoid this, you have to take care of closing all other form before this one.

Member Avatar for Samuel_25
0
1K
Member Avatar for sidyusuf

I would rather choose KeyPress event, where you can use "e" parameter and set its Handled property: [CODE] Private Sub textBox1_KeyPress(sender As Object, e As KeyPressEventArgs) If textBox1.Text.Length >= 10 Then If e.KeyChar <> ControlChars.Back Then e.Handled = True End If End If End Sub [/CODE]

Member Avatar for ddanbe
0
16K
Member Avatar for virusisfound

YOu cannot read a whole row of the dgv to a string. Ok, you can, but there will be no value you want to have. So you have to specify from which column and from which row you want to get the value. Lets repair your code: [CODE] //just make …

Member Avatar for pritam_4
0
6K
Member Avatar for charlybones

Try this: [CODE] string a = "12.34"; decimal b = Convert.ToDecimal(a, System.Globalization.CultureInfo.InvariantCulture); [/CODE]

Member Avatar for DOUGLAS_9
0
19K
Member Avatar for zifina

I would rather put the code which is not in the button Click event into a new method. Then you call this method in button clck in that form, and from another form, like: [CODE] //other form whih has a button click event: private void button_Click() { MethodToExecute(); } public …

Member Avatar for Andressa_1
0
5K
Member Avatar for ffonz
Member Avatar for fredw300

I`m afraid not. There is plenty of data to save. You can create a progressBar, which will show the progress of saving, and create a new thread which will do the saving (and restoring data back to richTextBox). Btw: but even the type varchar should do it. Maybe you didn`t …

Member Avatar for Hak_1
0
5K
Member Avatar for gozo12

Add a new class into your project and paste this code: [CODE] Imports System.Windows.Forms Public Class BetterListBox Inherits ListBox ' Event declaration Public Delegate Sub BetterListBoxScrollDelegate(Sender As Object, e As BetterListBoxScrollArgs) Public Event Scroll As BetterListBoxScrollDelegate ' WM_VSCROLL message constants Private Const WM_VSCROLL As Integer = &H115 Private Const SB_THUMBTRACK …

Member Avatar for Xavier_5
0
3K
Member Avatar for harsh01ajmera

Check out this way by using DialogResult (and passing data between forms or classes): 'PROGRAM class Class Program ''' <summary> ''' The main entry point for the application. ''' </summary> <STAThread()> _ Private Shared Sub Main() Application.EnableVisualStyles Application.SetCompatibleTextRenderingDefault(false) Dim loginData As String = "" Dim l As Login = New …

Member Avatar for Varun_9
0
3K
Member Avatar for prethum

Try to bind data. I mean, fill dataTable and bind it to dgv: [CODE] //retreive data from db to datatable: SqlDataAdapter adpat = new SqlDataAdapter(); adpat.SelectCommand = new SqlCommand("select * from ImgTB", con); DataTable table = new DataTable("myTable"); adpat.Fill(table); //create image column: DataGridViewImageColumn photoColumn = new DataGridViewImageColumn(); photoColumn.DataPropertyName = "Picture"; …

Member Avatar for coolcurrent4u
0
3K
Member Avatar for san_gwapo19

Here is my example code (which i did some time ago) and actually used is some where: [CODE] Public Shared Function NumberToWords(number As Integer) As String If number = 0 Then Return "zero" End If If number < 0 Then Return "minus " & NumberToWords(Math.Abs(number)) End If Dim words As …

Member Avatar for JamesCherrill
-1
4K
Member Avatar for Leon Guerrero

I actually dont understand what is wrong with your code based on your description. Do you want to try to add text from some other class to textbox?

Member Avatar for Erdogan
0
3K
Member Avatar for Falcon25

private List<string> list = new List<string>(); public List<string> List { get { return list; } set { list = value; } }

Member Avatar for JOSheaIV
0
19K
Member Avatar for missc

Check out this code. The 1st part is only a simple dgv population. Then is the code which color the rows: [CODE] public Form1() { InitializeComponent(); dataGridView1.Columns.Add("col1", "column 1"); dataGridView1.Columns.Add("col2", "column 2"); dataGridView1.Rows.Add(1, "Canceled"); dataGridView1.Rows.Add(2, "Ok"); dataGridView1.Rows.Add(3, "Canceled"); dataGridView1.Rows.Add(4, "Canceled"); dataGridView1.Rows.Add(5, "Ok"); foreach (DataGridViewRow row in dataGridView1.Rows) { if (dataGridView1["col2", …

Member Avatar for ian rey
0
6K
Member Avatar for cool_intentions
Member Avatar for compulove

Get all the textBoxes into an array, and read them (using Text property) into a StringBuilder class. Then write all to a text file: [CODE] Textbox[]tbs = { textBox1, textBox2, textBox3 }; // add all of them in here StringBuilder sb = new StringBuilder(); foreach(TextBox tb in tbs) sb.AppendLine(tb.Text); System.IO.File.WriteAllText(@"C:\myFile.txt", …

Member Avatar for ddanbe
0
211
Member Avatar for newack

No, you have to put the instance of the Random on the class level, then you will not have problems with getting random number every where (on load event, or on some button click event, or in some method): [CODE] //form1 class: Random r = new Random(); public Form1() { …

Member Avatar for lexii
1
398
Member Avatar for Behseini

Iam affraid you cannot put images into a listBox (without any additional hacking of the code). I would better suggest you to use ListView, which is meant for it.8df **Images to lsitview:** If you want to do this in the designer, you can take the following steps to add the …

Member Avatar for macgurl70
0
4K
Member Avatar for gurusamy

Me neither :) List<T> is best option. Maybe for some "simple" arrays its better to use a simple array, like string[], or int[]. But if you have a custom object, List is better choice, and even better is a generic list (List<T> - as Momerath described in the previous post).

Member Avatar for RichardGalaviz
0
562
Member Avatar for Wiizl

This is another version of updating Label`s text over the thread: [CODE] delegate void LabelDelegate(string message); public Form1() { InitializeComponent(); } private void UpdatingLabel(string msg) { if (this.label1.InvokeRequired) this.label1.Invoke(new LabelDelegate(UpdatingLabel), new object[] { msg }); else this.label1.Text = msg; } [/CODE] Its faster and easier...

Member Avatar for Matthew.diggide.speakman
0
7K
Member Avatar for jeffreylee

You can create a new connection from Server Explorer and copy connection strings from properties in your project. Following link contains steps to create connection from Server Explorer [url]http://msdn.microsoft.com/en-us/library/s4yys16a(v=VS.90).aspx[/url] You can try following Connectionstring Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; You can also get list of connection string from [url]http://connectionstrings.com/sql-server-2008[/url] ---------------------------------------------------------------------------------------------------- Do …

Member Avatar for vdixit01
0
838
Member Avatar for ajinkya112

Hi, I would recommend you to fill DataTable from DGV, but there is still not in-built way to do so. check this link: http://stackoverflow.com/questions/4720463/how-to-export-from-datatable-to-pdf-in-wpf

Member Avatar for jaga.dish.39
0
277
Member Avatar for ariez88

Did you bind the listBox1, using DataSource property from DataTable? If so, you have to 1st get the item and value from listBox item and add it some other place (in your case to listBox2): [CODE] for(int i = 0; i < listBox1.SelectedItems.Count; i++) { DataRowView view = listBox1.SelectedItem as …

Member Avatar for samkri
0
802
Member Avatar for lxXTaCoXxl

Yes it it, or even better it to use: [CODE]this.Dispose();[/CODE] The basic difference between Close() and Dispose() is, when a Close() method is called, any managed resource can be temporarily closed and can be opened once again. It means that, with the same object the resource can be reopened or …

Member Avatar for padillian
0
2K
Member Avatar for caello

I would go to use >= and <= operators to define the start end end date accordingly: [CODE]Dim query As String = "Select * from AFINITY where Description = @description and Datetgl >= @startDate and Datetgl <= endDate"[/CODE]

Member Avatar for jared.geli
0
2K
Member Avatar for vivekagrawal

You do: [CODE] //form1: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Form2 f2 = new Form2(textBox1.Text); f2.Show(); } } //form2: public partial class Form2 : Form { public Form2(string value) { InitializeComponent(); textBox1.Text = value; } } [/CODE]

Member Avatar for hilahilarious
0
8K
Member Avatar for yousafc#

Hi, check [URL="http://www.codeproject.com/KB/aspnet/ImageInDatabase.aspx"]here[/URL]. Remember you have to get Byte array (byte[]) from picture to save it into a dataBase.

Member Avatar for mostafarafi
1
5K
Member Avatar for Chair

Your code does not return the name string (value) from all over the method. It reutrns only from the while loop. What in case if the code does not go to while loop? It will return what? notihng. But your method return type is a string. That means you have …

Member Avatar for pritaeas
1
9K
Member Avatar for dennysimon

Create column in a constructor of form (or on load event): [CODE] DataGridViewImageColumn imageColumn = new DataGridViewImageColumn(); { imageColumn.Name = "colImages"; imageColumn.HeaderText = "Images"; imageColumn.Width = 100; imageColumn.ImageLayout = DataGridViewImageCellLayout.Stretch; imageColumn.CellTemplate = new DataGridViewImageCell(false); imageColumn.DefaultCellStyle.NullValue = null; } datagridview1.Columns.Insert(imageColumn, 1); //1 is an index of column - 2nd column [/CODE] …

Member Avatar for brianmanee
0
2K
Member Avatar for bahed121

Best would be to give us the code. Then we can point you into the righ direction...

Member Avatar for Nagarjungn
0
1K
Member Avatar for nettripper

You have to find our the screen resolution, and based on that, you then adjust your image (resize it). How to get screen resolution and resize image: [CODE] Dim width As Integer = Screen.PrimaryScreen.WorkingArea.Width Dim height As Integer = Screen.PrimaryScreen.WorkingArea.Height Dim image__1 As Image = Image.FromFile("filePathToImage") Dim newImage As New …

Member Avatar for oussama_1
0
881
Member Avatar for artemix22

Crystal Reports are not included in VS 2010. You have to install them by your self, and you an get them from SAP. Last version of VS that had Crystal Reports was previous one, 2008.

Member Avatar for Sqiar
0
182
Member Avatar for king03
Member Avatar for odai.khateeb
0
3K
Member Avatar for patel28rajendra

Hmm, Tellalca? What an answer is that?? If you want to comment threads like that, you better do NOT write at all. Otherwise you will be penelized, ok? Sorry for inconveniances. Ok, back to the thread`s topic, you can bind data from dataTable, which gets filled from database like this: …

Member Avatar for Hamid_2
0
605
Member Avatar for empuk2

Hi, would you mind telling us some more about what would you like to achive? I mean what is the source, and what to put together and the output of course. Otherwise salving problems when you have a key and multiple value can really be salved with the Dictionary collections, …

Member Avatar for walshregal
0
640
Member Avatar for tnsankaran

Yep.. do it this way: [CODE] Public Sub New() 'in constructor or in load event (before showing actually): comboBox1.DataSource = New BindingSource(table1, Nothing) comboBox1.DisplayMember = "Catname" comboBox1.ValueMember = "Carid" 'subscribe to an event: comboBox1.SelectedIndexChanged += New EventHandler(AddressOf comboBox1_SelectedindexChanged) End Sub 'event: Private Sub comboBox1_SelectedindexChanged(sender As Object, e As EventArgs) 'get …

Member Avatar for spider2vb
0
4K
Member Avatar for Mitja Bonca
Member Avatar for Balaji_1
0
245
Member Avatar for Newbie_ITstuden

It would be better to use datasource property of comboBox to pass data from table to comboBox: [CODE] Private Sub Form5_Load(sender As System.Object, e As System.EventArgs) Dim con As New SqlConnection() con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\lito\Documents\QMP_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" con.Open() Dim da As New SqlDataAdapter("select * from Subject_Info", con) Dim table …

Member Avatar for manlypullock
0
8K
Member Avatar for de Source

[QUOTE=de Source;1583558] i dont have any experience with datagridview so kindly express your solution in bit detail [/QUOTE] hmmm, this will take some time then... ;) Ok, regarding to your thread`s title, you want to pass data from textBox to DGV. You can do it this (Simple) way: [CODE] dataGrivView1[0,0].Value …

Member Avatar for cmdc08
0
1K
Member Avatar for Mitja Bonca

I am doing some more coding on listView, and I can not figurate it out how to salve the problem that there is always just one checkBox on the listView checked. On the listView I have some names. When I load it there is already a checked name - so …

Member Avatar for DjpjAmador
0
1K
Member Avatar for Abel21

I know it can be creates like: TextBox[] tbsArray = new TextBox[2]; tbsArray[0] = textBox1; tbsArray[1] = textBox2; //or: TextBox[] tbsArray = new TextBox[] { textBox1, textBox2 }; //or in a loop: foreach(TextBox tb in new TextBox[] { textBox1, textBox2 }) { //... } If there is any other way …

Member Avatar for Abel21
0
198
Member Avatar for shyam47

That you dont have any loop around the code which shows the progressBar? Or maybe you call the method multiple times? Please double check it.

Member Avatar for Mitja Bonca
0
208
Member Avatar for Leodumbi

Hi, I did much of the code you need. The code retreives the new new date and number. What is checks. - If the date in the stirng retreived from datebase (the last one) if older then today, it creates new "number", with today` date and number 1 after slash …

Member Avatar for luvprogram
0
223
Member Avatar for yousafc#

Hello, can you tell yo more about your issue. What exactly is "Udru" language? And what do you have in the has table? Can you show us the code you did? thx Mitja

Member Avatar for <M/>
1
1K
Member Avatar for hassan12345

Its hard to tell what can be wrong - obviousely the code hangs somewhere in between, in some loop. That means that the code came into an infinitive loop - it will circle forever. Why? I cannot tell you... but can you please share you code here, so we can …

Member Avatar for sumoncse05
0
1K
Member Avatar for JannuBl22t

Try with using HasSet collection: [CODE] class Program { static void Main(string[] args) { string[] array = { "a", "b", "c", "b", "d", "e", "c" }; string[] result = RemovingDuplicates(array); } private static string[] RemovingDuplicates(string[] array) { HashSet<string> set = new HashSet<string>(array); string[] result = new string[set.Count]; set.CopyTo(result); return result; …

Member Avatar for saclines
0
1K
Member Avatar for TheDocterd

Have you ever worked with retrieving data from dataBase, using sqlCOnnection? What you have to do is: Ok I have done a simple example of how to use parameters - pass them between methods and populate contols with them. [CODE] private void button1_Click(object sender, EventArgs e) { string item = …

Member Avatar for Ketsuekiame
0
2K

The End.