2,383 Posted Topics
Re: It because there is no SubItems(3) in your listview.. And why you show Owner ID twice in all of your codes? modified as following " [CODE]Set lst1 = lvStudentInfo.ListItems.Add With lst1 .Text = rs!Owner_ID .SubItems(1) = rs!Owner_Name .SubItems(2) = rs!Owner_Address End With[/CODE] | |
Re: Your code is fine. you just need to hide textboxes when form load. So, when your checkbox checked it will be visible : [CODE] private void Form1_Load(object sender, EventArgs e) { textBox4.Visible = false; textBox5.Visible = false; } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) { textBox$.Visible = … | |
Re: An example : [CODE]Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick Dim i As Integer = DataGridView1.CurrentRow.Index With DataGridView1 If DataGridView1.Item(0, i).Value = "1" Then textbox1.text="hello" End If End With End Sub[/CODE] | |
Re: [URL="http://www.freevbcode.com/ShowCode.asp?ID=1371"]Use SHFormatDrive API Fucntion.[/URL] | |
Re: [QUOTE][CODE]commandString = "Select * from tableadd where " + this.comboBox1.SelectedText + "like '%" + textBox1.Text + "%'" ;[/CODE] [/QUOTE] Your code should be correct. Try to add space before like statement. [CODE]commandString = "Select * from tableadd where " + this.comboBox1.SelectedText + " like '%" + textBox1.Text + "%'" ;[/CODE] | |
Re: See if this helps : API Declare : [CODE]Option Explicit Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long Private Type SHFILEOPSTRUCT hwnd As Long wFunc As Long pFrom As String pTo As String fFlags As Integer fAnyOperationsAborted As Long hNameMappings As Long lpszProgressTitle As Long … | |
Re: [QUOTE]when the input is 12 years and 6 months I want the program to print teenager I'm not sure how to do that [/QUOTE] Input should be 12.6 to get right result. so you can concatenate textbox1 (for year) and textbox2 (for month) : [CODE]Private Sub Command1_Click() Select Case Val(Text1.Text) … | |
Re: I assume you use listbox for all controls : You can use '&' ampersand sign to concatenate all items with same index for every listbox. See this following code : [CODE]Private Sub Command1_Click() For i = 0 To List1.ListCount - 1 List4.AddItem List1.List(i) & List2.List(i) & List3.List(i) ' add items … | |
Re: add component for flash player : Right click on control toolbox->add/remove item->select the com component tab -> find add shockwave flash object. this control will show in my user control on control toolbox. to play add this code : [CODE] AxShockwaveFlash1.Stop() AxShockwaveFlash1.Movie = FilePath & "\FileName.swf" AxShockwaveFlash1.Play() [/CODE] | |
Re: [QUOTE]but when i'm trying to input grades for the other student i can't save the grade but there is no error shown[/QUOTE]. it cause you using "On Error Resume Next" statment on line 2. Delete this line and you will know what the error is if error detected. | |
Re: See if this helps : [CODE]Private Sub EnumFolders(fld As Object) Dim oShell As Object, fldItem As Object Dim i As Long On Error Resume Next Set oShell = CreateObject("Shell.Application") For Each fldItem In fld.Items If fldItem.IsFolder Then Call EnumFolders(fldItem) End If list1.AddItem fld.GetDetailsOf(fldItem, 0) Next Set fldItem = Nothing Set … | |
Re: Rename your exe project with system name like services.exe, etc. | |
Re: I don't understand what you want exactly. You want to swap items index? | |
Re: You can use many ways here.. Here is an example : [CODE]Private Sub Save_Click() Set Conn = New ADODB.Connection Conn.Provider = "microsoft.jet.oledb.4.0" Conn.CursorLocation = adUseClient Conn.Open App.Path & "\Authors2.mdb" For i = 0 To List1.ListCount - 1 Set rs = Nothing Set rs = New ADODB.Recordset rs.Open "SELECT * from … | |
Re: [URL="http://www.smsco.it/en/sms_tutorials/sms_from_vb6_visual_basic.jsp"]See This Tutorial[/URL] | |
Re: How far you doing this? post your code. where the error is. we're going to help you. | |
Re: Use if-else statement : [CODE]If Option1.Value = True Then ' Your code if user select radio button 1 ElseIf Option2.Value = True Then ' Your code if user select radio button 2 End If[/CODE] | |
Re: See if this help. Add a timer, set interval to 1000 (or you can assign as you needed) And use this following code : [CODE]Private Sub Timer1_Timer() Label1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255) End Sub[/CODE] | |
Re: [QUOTE]I need help for my program.. I add a search the Adodc in my program with a combo box category, but when i run the program and search... the category "ID" not searching..[/QUOTE] You said that category ID is not searching. How about another category? If other category is successful … | |
Re: Manipulate your sql query to receive input from textbox and put the code in textbox_change() event.. [CODE]Private Sub Text1_Change() ' your code here End Sub[/CODE] | |
Re: [QUOTE]Please gave me some idea[/QUOTE] Use Sum function in your sql query. [QUOTE]or Code Thx [/QUOTE] modified as you needed : [CODE]Private Sub Command1_Click() Dim Conn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim sConnect As String sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "emp.mdb" 'Replace emp with your … | |
Re: in vb6 you can use Replace() function : [CODE]Replace(YourStringHere, " ", "")[/CODE] | |
Re: [URL="http://msdn.microsoft.com/en-us/library/system.datetime.compare.aspx"]Use DateTime.Compare(date1, date2) [/URL] | |
Re: Just trap the ascii code, So user only can input numbers. This following code just accept numbers input only : [CODE]Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, 8 '0-9 and backspace 'Let these key codes pass through Case Else 'All others get trapped KeyAscii = … | |
Re: See this following code : [CODE]For i As Integer = 0 To ListBox1.SelectedIndices.Count - 1 ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) Next[/CODE] Or you use this too : [CODE]Do While (ListBox1.SelectedItems.Count > 0) ListBox1.Items.Remove(ListBox1.SelectedItem) Loop[/CODE] | |
This Code is easy way to load / show data in Datagrid. This Code write in vb.net 2003 and use sqlserver 2000 as database. I use module to connected VB.Net with SqlServer 2000. so the function to connected can be use in every form in this project. | |
Re: Try this : [CODE]Dim ctrAs Control For Each ctr In Me.Controls If TypeOf ctr Is TextBox Then If ctr.Text= vbNullString Then MsgBox "Textbox empty" ctr.SetFocus Exit Sub End If End If Next ctr[/CODE] | |
Re: See if this help : [CODE]Private Sub Command1_Click() List1.Clear x = 0 For j = 1 To Len(Trim(Text1.Text)) kt1 = Mid(Trim(Text1.Text), j, 1) kta = kta + kt1 If kt1 = Chr(32) Then x = x + 1 List1.AddItem Trim(kta) kta = "" End If Next j If x >= … | |
Re: >>what connection will i use and how and sample codes. You want to connect with access 2007 or you want to make report of your db? Anyway how far you doing this? | |
Re: See if this helps : [CODE]Private Sub ListFiles(strPath As String, Optional Extention As String) 'Leave Extention blank for all files Dim File As String If Right$(strPath, 1) <> "\" Then strPath = strPath & "\" If Trim$(Extention) = "" Then Extention = "*.*" ElseIf Left$(Extention, 2) <> "*." Then Extention … | |
Re: How far you doing this? Give some effort.. | |
Re: See if this helps : [CODE]Public Function ChangeFileExt(ByVal aFilename As String, ByVal NewExt As String) As Boolean Dim p As Long Dim bp As Long Dim nFileName As String On Error Resume Next ChangeFileExt = False If aFilename = "" Then Exit Function p = 0 Do bp = p … | |
Re: You can access form control using second form name as object. Put this code in any event you want : [CODE]Form2.Label1.Caption = Label1.Caption[/CODE] | |
Re: So what the problem is? How far you doing this? showing your effort. | |
Re: Try this : [CODE]Private Sub Command1_Click() MsgBox Printer.DeviceName End Sub [/CODE] | |
Re: As ChrisPadgham said..that is a simplest way. This following is other way (But Still needed to use Looping): [CODE]For Each controlx In Form1.Controls If TypeOf controlx Is TextBox Then controlx.BackColor = vbRed Next controlx[/CODE] | |
Re: >>If the optInst is selected at line 31 then chkMast or chkDoct needed to be weighted by 1.3. You mean if RB Instructor is selected then checkbox master and doctor should be checked? [CODE]Private Sub optInst_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles optInst.CheckedChanged lblSalOutput.Text = FormatCurrency(CInt(sumTotal())) If optInst.Checked … | |
Re: [QUOTE]would you help me, how to create table (ACCESS) with primary key in visual Basic 6? [/QUOTE] Well, your code is not completed since you never add all created columns to catalog(catDB) and also missing "End With" statement. To create PK you need to append a new key : I … | |
Re: [URL="http://www.ozgrid.com/forum/showthread.php?t=28221"]See this.[/URL] | |
Re: How far you doing this? | |
Re: See if this help : [CODE]Shell("shutdown -s") 'Shutdown[/CODE] | |
Re: First your database just contain user table only. I suggesting you to make complete your database. It useless when your database is not completed. | |
Re: Make sure that your table (login) is exists in your database and table name spell correctly. | |
Re: See if this helps : Need 1 Module and 1 Button. In Module : [CODE]'Author : Gernan Mejia Aka DJ Unreal 303 'Language : VB5, VB6 'Operating Systems : Windows 9x, NT, 2000, Me, XP '------------------------------------------------------- Type PROCESSENTRY32 dwSize As Long cntUsage As Long th32ProcessID As Long th32DefaultHeapID As Long … | |
Re: You can use [ICODE]Mid()[/ICODE], [ICODE]Left()[/ICODE] or [ICODE]Right()[/ICODE] function to get The first four characters and the last 3 characters and Use [ICODE]Len()[/ICODE] for the length of text. | |
Re: what you mean about position in text at textbox? please give more information. | |
Re: Try this [CODE]Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For i As Integer = 1 To 5 CheckedListBox1.Items.Add(i) Next CheckedListBox1.CheckOnClick = True 'Checked item when you select it End Sub Private Sub CheckedListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckedListBox1.SelectedIndexChanged If CheckedListBox1.SelectedItem.ToString = … | |
![]() | Re: >> All works very well, but I cannot restore the form. What you mean about cannot restore? I tried the code and it works great. I can restore it too. After minimize the form, left click the icon on system tray taskbar Or You can right click the icon and … ![]() |
The End.