1,469 Posted Topics
Re: 1st of all, if you use radionButton, there is always one selected (its not the same as checkBoxes, where you can deselect all). Ok, its possible to deselect all radionButtons in a group as well, but this is not the purpose then in using radionButtons. About showing the button control, … | |
Re: Just to add: ... be careful here. adatapost is correct, but be careful in two things - row index - column index You have to state the correct indexes, and for the column you can even state the column name! | |
Re: No, Icannot be, or you did it wrong. Check this example: Dim d1 As New DateTime(2011, 12, 31) Dim d2 As New DateTime(2012, 1, 1) Dim ts As TimeSpan = d2.Subtract(d1) Console.WriteLine("Difference between these two times is:" & vbCr & vbLf & "years: {0}" & vbCr & vbLf & "months: … | |
Re: I assume you are trying to create a code for checking the password strenght. Here is some of my code I used to have for it: Private Enum PasswordScore Blank = 0 VeryWeak = 1 Weak = 2 Medium = 3 Strong = 4 VeryStrong = 5 End Enum Private … | |
Re: Please provide us some deicent explanation if you want any help from us. These 2 images do nothing. | |
Re: loop through rows of gridview and check the column of checkbox (if checked (true) add to database, if not do nothing. foreach(DataGridViewRow row in dgv.Rows) { DataGridViewCheckBoxCell check = row.Cells[0] as DataGridViewCheckBoxCell; //0 represents 1st column; change the index to your column if ((bool)check.Value) { //insert this row (checkBox is … | |
Re: why would you combine two datetimes? Can you explain this better? | |
Re: And you will populate (show) all bnames into textbox1, and all anames into textbox2? How they will be seperated? This is not a good idea, better use a listBox, so items will be in a seperated rows. | |
Re: Are these textBoxes on same form? I would suggest you to create an array of textBoxes (in order, like you will populate them), and then just loop through them and fill text into each of them. Example: TextBox[] tbs; public Form1() { tbs = new TextBox[]{textBox1, textBox2, textBox3 }; //put … | |
Re: This question has been asked a couple of times. Please do NOT duplicte threads. One will be just fine. Close this one. | |
Re: Show us your Designer code of the form (whole code). Its hard to tell what can be wrong, but for sure there is some "additional" code that changes position of controls. | |
Re: Like: Using conn As New SqlConnection("connString") Using cmd As SqlCommand = New SqlComand("SELECT ColumnName FROM TableName", conn) Using reader As SqlDataReader = cmd.ExecuteReader() While reader.Read() comboBox1.Items.Add(reader(0).ToString()) End While End Using End Using End Using | |
Re: But I guess you would like to get all whats inside li tags, so all within <li>...</li>? Am I correct? If so, this is the pattern and the code you can use: string pattern = @"<li>(.*?)</li>"; Regex regex = new Regex(pattern); //1. if one occurence in a string: Match match … | |
Re: or; '1 Dim controls As TextBox() = Me.Controls.OfType(Of TextBox)().OrderBy(Function(o) o.Name).ToArray() 'then you can loop in foreach (like bellow) '2. For Each control As var In Me.Controls.OfType(Of TextBox)() Dim name As String = control.Name Next ![]() | |
Re: When do you add them exactly? I hope AFTER binding it. And I would use Insert method, not Add. Where you have to specify 2 arguments: - DGV column reference - index of column to insert (starting from 0 up (0 is 1st column, 1 is 2nd column,...) But I … | |
Re: Try using Linq to xml, and check here: http://msdn.microsoft.com/en-us/library/bb308960.aspx#xlinqoverview_topic1a | |
Re: Why so much code needed to paste it here? Next time paste only the code needed. Ok? Ok, to thread`s topic: Create an array of images (Bitmap or Image classs). Put a timer (System.Windows.Timer for instance) and initialize it. Set some properties, like the Interval (on how many time the … | |
Re: Check here for an answer: http://www.dotnetcurry.com/ShowArticle.aspx?ID=196 | |
Re: Create it as a login form (in same way): static class Program { [STAThread] static void Main() { using (Splash splash = new Splash()) { splash.StartPosition = FormStartPosition.CenterScreen; if (splash.ShowDialog() == DialogResult.OK) { Application.Run(new Form1()); } } } } //inside Splash form do: //use some Timer or something, and after … | |
Re: try using this code: testBox.Text = Clipboard.GetText(TextDataFormat.Rtf); | |
Re: > I want message to be displayed when user moves the mouse through hardware only (i.e moving mouse with hand) What would that suppose to mean? You mean moving cursor with keyboard (directional keys)? | |
Re: You dont need to convert it, but you simply bind it to dgv. Using dataSource property of dgv, assgin dataTable to it: dgv.DataSource = dataTable.DefaultView; | |
Re: create new select query and use a WHERE clasue as an item from 1st drop down list (catgory). Then fill datatable, and bind it to 2nd drop down list. | |
Re: Loop through the rows of particular column: 1. List<string> usersOver30 = new List<string>(); foreach(DataGridViewRow row in dataGridView1.Rows) { int age = 0; if(int.TryParse(row["Age"].Value.ToString(), out age)) if(age >= 30) usersOver30.Add(row["Name"].Value.ToString(); } //list contains all names of users that are over 30 years old 2. foreach(DataGridViewRow row in dataGridView1.Rows) { DataGridViewCell cell … | |
Re: hi, read here: [http://stackoverflow.com/questions/191153/when-would-you-use-delegates-in-c](http://stackoverflow.com/questions/191153/when-would-you-use-delegates-in-c) | |
Re: I completely agree with Unhnd. This is a waste of time. What if user inserts some other numbers, like 123456? This will never work well. You have to force user to SELECT a date, so choose between datetimepicker, or monthcalendar. I know I would defenatelly - bad experiances from before … | |
Re: > Specifically, they would notice that for e.g the communications timers wont work if the code for the acquisition took more time than the min. timer interrupt for the communication code. They suggest using threads. Can you please provide more detailed issue description? Its hard to tell you a solition … | |
Re: Yes and your exact question would be? Show us some example code, with the calculations, I mean. | |
Re: If there is any field in your database (all others then varchar - string actually) you must provide this type. I see you provide for example "xyz" parameter, which is (surely) an integer, you have to convert string to integer (thats why you got this kind of exception). so like … | |
Re: If you use logical and "&&" this means if you want to go into while loop all of three threads muste be alive. And this something you dont want, right? Maybe is that "itc" variable true? Is it possible? | |
Re: try using this select query statement: "select table_name as Name from INFORMATION_SCHEMA.Tables where TABLE_TYPE = 'BASE TABLE'"; | |
Re: use for loop, but instead of incrementing +1, do the reverse operation, so each step -1: for (int i = dgv.Rows.Count; i > 0; i--) { DataGridViewRow row = dgv.Rows[i] as DataGridViewRow; //use row for your insertion } | |
![]() | Re: Variable (in your case a generic list) declared as public static is one solution to use it all over the project. But if has its own weaknesses, like that it stays in memory for as long as your project is alive. And if the variable becomes huge, it can eat … ![]() |
Re: You can do it like: Const PenaltyPerDey As Decimal = 10D Private Sub MyMethod() Dim exired As New DateTime(2012, 4, 9) Dim penalty As Decimal = CalculatePenalty(exired) End Sub Private Function CalculatePenalty(expired As DateTime) As Decimal Dim ts As TimeSpan = DateTime.Now.Subtract(expired) Dim totalDays As Integer = ts.Days Return CDec(totalDays) … | |
Re: And your question is? You know, we wont do the code instead of you - be sure about that. So if you need any help, ask us, and would be more the glad to help. | |
Re: RichBoxControl defenatelly. It can take text (every type of it - riched too, thats why the name of the control) and even images. | |
Re: Are you sure you have the connect connection string? Is this access database? Please double check the correctness of connection string. Else I cannot suggest you now. | |
Re: Which part would you like to make chages (bold text)? Text like it self (string value) cannot be bold or anything. But you can change its visibility when passign it to some control, like textbox: textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style | FontStyle.Bold | FontStyle.Underline); | |
Re: Try using TryParse method: invalue = textBox1.Text; if(int.TryParse(invalue, out guessedNumber)) { //contine here } else MessageBox("Input value is not a number."); | |
Re: Depends what you would like to do. Maybe there is nothing yet to change, maybe its a lot. Show us your code, and tell us what you would like to be different in win app. | |
Re: Check links: http://converter.telerik.com/ http://www.developerfusion.com/tools/convert/vb-to-csharp/ | |
Re: Try it this way: ' 1. create columns ot listView!! ' 2. then loop through the row and columns to datatable: ' NOTE: make sure that the number of columns in listView IS equal to columns to datatable!! For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 Dim lvi … | |
Re: why did you name your string varaible as "Regex"? You cannot do that, sice Regex is a reserved word of C#. | |
Re: Where exactly do you wanna show the data? In textBoxes or in some data collection control (like datagridview)? Depends on data binding. | |
Re: Can you write is down the tables structure (table names)? So we can see what is the connection between those 2 tables. | |
Re: If you create a file you have to close or better dispose Create() method: File.Create("filePath_and_fileName").Dispose() 'now you can use StreamWriter class... | |
Re: Try: this.WindowState = FormWindowState.Maximized; this.FormBorderStyle = FormBorderStyle.None; | |
Re: Lets go through your needes: You have a form1. From it you open form2. On form2 you have a checkBox, and when you check it, you want the form1 to show on top of the form2. Is that correct? | |
Re: When you open it, call it with ShowDialog() method, like: Form2 f2 = new Form2(); f2.ShowDialog(); |
The End.