|
Hello Experts
i am working on a VB 6.0 Project
i am using Datacombo1 and a Text box,
what i want that when i am typing in text box datacombo1 must
Highlighted matched items.
How can i do that.
Your Help will be appreciated.
|
|
|
|
|
It looks like a DataCombo can have only one item selected at a time. I'm guessing you would have to handle the TextChanged event in the TextBox and search through the DataCombo's data, one item at a time, and find the first item in the list that matches what was typed. Then you take that index number and set the DataCombo's SelectedItem property with it.
No, I don't have any examples, 'cause I haven't used VB6 in over 7 years.
|
|
|
|
|
hello
iam working on old soluation vb.net 2003
i have problem
i have general dataset
that used n reports
so i add new element in that dataset
and i update my report to see new field to add in report
but it can't see new filed
i need help
thanks
md_refay
|
|
|
|
|
whether you use crystal report?
if yes, then from Menu Crystal Report, select Database and then Verify Database
|
|
|
|
|
|
Core Programmers wrote: Please give some suggestions....
suggestion : go somewhere else ?
this question gets asked here quite frequently. The general stand is we dont support the writing of code like this wherein the basic intent is 'dubious'/'less than kosher' (or just plain malicious)
'g'
|
|
|
|
|
Hi, does anyone one know what sort of wave header the My.Computer.Audio Play routines require?
I am creating wave files with a basic standard header, which play fine in Windows Media Player, Audacity, VLC etc, but as soon as I try to play them in the program using Play, it says the header is corrupt. These are very low sample rate files. Could that have something to do with it? They are often as low as 600 Hz (Sound files of seismic activity). They are PCM 16 bit uncompressed.
The help (VB/MSDN and various other sources) gives very little detail, and anyway details of wave files seems to be difficult to come by unless you are takling music/stereo/44000 sample rate etc.
Still working my way trough 13,600 entries on MSDN but nothing relevant sp far!
|
|
|
|
|
Sorry, jumped the gun. I found the answer. Seems to be a bug you can get round with:
Private player As New System.Media.SoundPlayer() <br />
Public Sub PlaySound(ByVal sound As Stream) <br />
sound.Position = 0 <br />
' Manually rewind stream <br />
player.Stream = Nothing <br />
' Then we have to set stream to null <br />
player.Stream = sound <br />
' And set it again, to force it to be loaded again... <br />
player.Play() <br />
' Yes! We can play the sound! <br />
End Sub
Apparently when you use the Audio Play it starts the end of the stream for some reason.
|
|
|
|
|
Public Class Form12
Dim ds As New DataSet
Dim da As New SqlClient.SqlDataAdapter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim CN As New SqlClient.SqlConnection
CN.ConnectionString = "Data Source=homepc\sqlexpress;Initial Catalog=Northwind;Integrated Security=True"
Dim cmd As New SqlClient.SqlCommand
cmd.Connection = CN
cmd.CommandText = "Select * From Customers"
da.SelectCommand = cmd
da.Fill(ds, "Customers")
da.Fill(ds, "CustomersDummy")
Dim PK(0) As DataColumn
PK(0) = ds.Tables("Customers").Columns("CustomerId")
ds.Tables("Customers").PrimaryKey = PK
MsgBox("ok")
Me.DataGridView1.DataSource = ds
Me.DataGridView1.DataMember = "Customers"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MsgBox(Me.ds.Tables.Count)
Me.ComboBox1.Items.Clear()
For Each tbl As DataTable In ds.Tables
Me.ComboBox1.Items.Add(tbl.TableName)
Next
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim tbl As DataTable = ds.Tables(Me.ComboBox1.SelectedItem)
Me.ComboBox2.Items.Clear()
For Each col As DataColumn In tbl.Columns
Me.ComboBox2.Items.Add(col.ColumnName)
Next
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim tbl As DataTable = ds.Tables(Me.ComboBox1.SelectedItem)
Dim Ans As String = ""
For Each dr As DataRow In tbl.Rows
Ans &= dr.Item(Me.ComboBox2.SelectedItem) & ", "
Next
MsgBox(Ans)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim dr As DataRow
Dim Str As String = InputBox("Enter Customerid")
dr = ds.Tables("Customers").Rows.Find(Str)
If dr Is Nothing Then
MsgBox("Not found...")
Exit Sub
End If
MsgBox(dr.Item("ContactName") & "-" & dr.Item("Country"))
dr.BeginEdit()
dr.Item("ContactName") = "Mr. " & dr.Item("ContactName")
dr.Item("Country") = dr.Item("Country").ToString.ToUpper
dr.EndEdit()
MsgBox(dr.Item("ContactName") & "-" & dr.Item("Country"))
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim dr As DataRow
For Each dr In ds.Tables("Customers").Rows
dr.BeginEdit()
dr.Item("Country") = dr.Item("Country").ToString.ToUpper
dr.EndEdit()
Next
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim dr, drs() As DataRow
drs = ds.Tables("Customers").Select("Country = 'UK'")
For Each dr In drs
dr.BeginEdit()
dr.Item("ContactName") = dr.Item("ContactName").ToString.ToUpper
dr.EndEdit()
Next
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Dim Row As DataRow
Row = ds.Tables("Customers").NewRow
Row.BeginEdit()
Row.Item("CustomerId") = "SAMIR"
Row.Item("ContactName") = "ABC"
Row.Item("ContactTitle") = "XYZ"
Row.Item("Country") = "INDIA"
Row.EndEdit()
ds.Tables("Customers").Rows.Add(Row)
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim dr As DataRow
Dim Str As String = InputBox("Enter Customerid")
dr = ds.Tables("Customers").Rows.Find(Str)
If dr Is Nothing Then
MsgBox("Not found...")
Exit Sub
End If
dr.Delete()
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Dim Criteria As String = "Country = 'UK'"
Dim Ans As Integer
Ans = ds.Tables("Customers").Compute("Count(CustomerId)", Criteria)
MsgBox(Ans)
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Dim Criteria As String = "Country Like '" & Me.TextBox1.Text & "*'"
Dim dv As DataView
dv = ds.Tables("Customers").DefaultView
dv.RowFilter = Criteria
Me.DataGridView1.DataSource = dv
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
Dim CN As New SqlClient.SqlConnection
CN.ConnectionString = "Data Source=homepc\sqlexpress;Initial Catalog=Northwind;Integrated Security=True"
Dim StrSql As String
StrSql = "Update Customers Set Country = Upper(Country) "
StrSql &= " Where Country = 'UK'"
Dim cmd As New SqlClient.SqlCommand
cmd.Connection = CN
cmd.CommandText = StrSql
Try
CN.Open()
cmd.ExecuteNonQuery()
MsgBox("Ok")
Catch ex As Exception
MsgBox(ex.Message)
Finally
CN.Close()
End Try
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
Dim CN As New SqlClient.SqlConnection
CN.ConnectionString = "Data Source=homepc\sqlexpress;Initial Catalog=Northwind;Integrated Security=True"
Dim StrSql As String
StrSql = "Select Count(*) From Customers"
Dim cmd As New SqlClient.SqlCommand
cmd.Connection = CN
cmd.CommandText = StrSql
Dim Ans As Integer
Try
CN.Open()
Ans = cmd.ExecuteScalar
MsgBox(Ans)
Catch ex As Exception
MsgBox(ex.Message)
Finally
CN.Close()
End Try
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
Dim CN As New SqlClient.SqlConnection
CN.ConnectionString = "Data Source=homepc\sqlexpress;Initial Catalog=Northwind;Integrated Security=True"
Dim StrSql As String
StrSql = "Select * From Customers"
StrSql &= " Where Country = 'UK'"
Dim cmd As New SqlClient.SqlCommand
cmd.Connection = CN
cmd.CommandText = StrSql
Dim dr As SqlClient.SqlDataReader
Dim Ans As String
Try
CN.Open()
dr = cmd.ExecuteReader
Do While dr.Read
Ans &= dr.Item("CustomerId") & ", "
Loop
MsgBox(Ans)
Catch ex As Exception
MsgBox(ex.Message)
Finally
dr.Close()
CN.Close()
End Try
End Sub
Private Sub Form12_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
|
|
|
|
|
Since you didn't ask a question I will:
do you already have any idea why you are getting more 1-votes than you have posted messages around here?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
This guy is a retard. Seriously, he posts like this every day.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Well, it's obvious you don't have a clue how to use a forum. You have 20 posts, and have yet to ask a question anyone can answer.
|
|
|
|
|
Are you using this site as a tool for source control?
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
|
|
|
|
|
Hi everyone.
I use this commands to set registry values for file association.
My.Computer.Registry.ClassesRoot.CreateSubKey(".plt").SetValue("", "HPGL_FILE", Microsoft.Win32.RegistryValueKind.String)
My.Computer.Registry.ClassesRoot.CreateSubKey("HPGL_FILE\shell\open\command").SetValue("", "C:\programmi\av\avwin\avwin.exe" & _
" ""%l"" ", Microsoft.Win32.RegistryValueKind.String)
My.Computer.Registry.ClassesRoot.CreateSubKey("HPGL_FILE\DefaultIcon").SetValue("", "C:\programmi\av\avwin\avwin.exe,1", _
Microsoft.Win32.RegistryValueKind.String)
It works fine if the extention is not already associated with another program.
I think I miss something
Thank you in advance!
Matteo
|
|
|
|
|
The problem I see is that your call CreateSubKey on a key that already exists, it won't return an object that SetValue can be called on.
Seperate these calls into seperate calls. Don't chain object call onto object call. Verify that you actually have an object before you make a call on it.
|
|
|
|
|
Thank you for your reply.
In my case it works the same, but you're right.
It's syntactically correct to check if the key exists trying to open it.
But the problem remains.
After the modification of that keys, the extention continues to open the old program.
Any other idea?
|
|
|
|
|
After running this code, open Explorer and see if the change was made in the File Extensions, under Tools->Options.
|
|
|
|
|
could anyone please give me a proper link to download merge module to deploy a project with Crystal report
I am using vb.net2005
thanks in advance
I am a beginner
<div class="ForumMod">modified on Friday, March 6, 2009 8:52 AM</div>
|
|
|
|
|
You'll havde to contact SAP support for this one. Since SAP took over BusinessObject, none of the links for CR merge modules work anymore.
|
|
|
|
|
Hi,
I have a Crystal Report document which contains a parameter field. The parameter field is set to allow multiple values. In my VB application I have an array of strings which I want to pass to the Crystal Report parameter field. I have tested the report from with Crystal Reports application using the values contained within the array and the report works fine which leads me to believe that there is a problem with my code. The problem being that when the report is displayed, only the last item in the array seems to have been added to the parameter list.
Here is my code for adding the contents of the ArrayList to the parameter:
Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues
crParameterFieldDefinitions = crReport.DataDefinition.ParameterFields
crParameterFieldLocation = crParameterFieldDefinitions.Item(strParameterName)
crParameterValues = crParameterFieldLocation.CurrentValues
For Each strParam As String In arrParameterValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = strParam
crParameterValues.Add(crParameterDiscreteValue)
Next
crParameterFieldLocation.ApplyCurrentValues(crParameterValues)
Any body have any ideas where I am going wrong? Thanks in advance.
(BTW: Using VB.NET framework 2 and Crystal Reports 11)
|
|
|
|
|
Hi,
I wrote a usercontrol based on a picturebox. It reprecend 2 textboxes on a scare but diagonal separated. How can I give it focus; i already tryed
control.focus but becourse it is a picturebox (i think thats the reasen)it wont work.
Jan
if someone has another/beter idee thats also welcome
|
|
|
|
|
A PictureBox is not a control that holds an editable value. This means that it's only there to display things, and that's why it can't get focus.
Is there a reason why you are bound to a picturebox, or can you swap it for a UserControl? You can set a background-picture on those too, if I'm not mistaken
I are troll
|
|
|
|
|
Thanks for the help
Here is the result
Public Class DiagonalDoubleTextBox
#Region "Declare"
Enum eDirection
LeftUp2rightDown
RightUp2LeftDown
End Enum
Dim _Direction As eDirection = eDirection.RightUp2LeftDown
Dim _clrDiaLine As Color = Color.Red
Dim _text() As String = {"U", "A"}
Dim _activeCell As Integer = 1
Dim _BackColor1 As Color = Color.White
Dim _Forecolor1 As Color = Color.Black
Dim _ForeColor0 As Color = Color.White
Dim bm00, bm10, bm01, bm11 As Bitmap
#End Region
#Region "Propertys"
Property BackColor1() As Color
Get
Return _BackColor1
End Get
Set(ByVal value As Color)
_BackColor1 = value
MyBase.Invalidate()
End Set
End Property
Property ForeColor0() As Color
Get
Return _ForeColor0
End Get
Set(ByVal value As Color)
_ForeColor0 = value
MyBase.Invalidate()
End Set
End Property
Property ForeColor1() As Color
Get
Return _Forecolor1
End Get
Set(ByVal value As Color)
_Forecolor1 = value
MyBase.Invalidate()
End Set
End Property
Property Direction() As eDirection
Get
Return _Direction
End Get
Set(ByVal value As eDirection)
_Direction = value
MyBase.Invalidate()
End Set
End Property
Property ColorDiagonalLine() As Color
Get
Return _clrDiaLine
End Get
Set(ByVal value As Color)
_clrDiaLine = value
MyBase.Invalidate()
End Set
End Property
Property Tekst(ByVal Index As Integer) As String
Get
Return _text(Index)
End Get
Set(ByVal value As String)
If value.Length > 1 Then value = value.Remove(2, value.Length - 1)
_text(Index) = value
MyBase.Invalidate()
End Set
End Property
#End Region
#Region "Handles"
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static b As Boolean
b = Not b
Select Case _activeCell
Case 0
Select Case b = True AndAlso Me.Focused
Case True
Me.BackgroundImage = bm01
Case False
Me.BackgroundImage = bm00
End Select
Case 1
Select Case b AndAlso Me.Focused
Case True
Me.BackgroundImage = bm11
Case False
Me.BackgroundImage = bm10
End Select
End Select
End Sub
Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
Me.Size = New Size(30, 30)
Me.BackColor = Color.Black
Me.BorderStyle = Windows.Forms.BorderStyle.Fixed3D
' Add any initialization after the InitializeComponent() call.
End Sub
#End Region
#Region "Protected Sub"
Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
_text(Math.Abs(Not -_activeCell)) = e.KeyChar
MyBase.OnKeyPress(e)
End Sub
Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
Me.Width = Me.Height
MyBase.OnResize(e)
End Sub
Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.PageDown Or e.KeyCode = Keys.PageUp Then
_activeCell = Math.Abs(Not -_activeCell)
End If
MyBase.OnKeyDown(e)
End Sub
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim b As Bitmap = Me.BackgroundImage
Dim c As Color = b.GetPixel(e.X, e.Y)
If c.A = BackColor.A AndAlso c.B = BackColor.B AndAlso c.R = BackColor.R AndAlso c.G = BackColor.G Then
_activeCell = 1
Me.BackgroundImage = bm10
Else
_activeCell = 0
Me.BackgroundImage = bm00
End If
MyBase.OnMouseDown(e)
End If
Me.Focus()
End Sub
Protected Overrides Sub OnMarginChanged(ByVal e As System.EventArgs)
MyBase.Refresh()
MyBase.OnMarginChanged(e)
End Sub
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
bm00 = sMakePictures(0, 0)
bm01 = sMakePictures(0, 1)
bm10 = sMakePictures(1, 0)
bm11 = sMakePictures(1, 1)
MyBase.OnPaint(e)
End Sub
#End Region
#Region "Functions"
Function sMakePictures(ByVal nCel As Integer, ByVal nBlinkOn As Integer) As Bitmap
Dim i As New Bitmap(Me.Width, Me.Height)
Dim g As Graphics = Graphics.FromImage(i)
If _Direction = eDirection.LeftUp2rightDown Then
Dim p() As Point = {New Point(0, 0), New Point(Me.Width - 2, 0), New Point(Me.Width - 2, Me.Height - 2)}
g.FillPolygon(New SolidBrush(_BackColor1), p)
p(1) = New Point(0, Me.Height - 2)
g.FillPolygon(New SolidBrush(Me.BackColor), p)
Else
Dim p() As Point = {New Point(0, 0), New Point(Me.Width - 2, 0), New Point(0, Me.Height - 2)}
g.FillPolygon(New SolidBrush(_BackColor1), p)
p(0) = New Point(Me.Width - 2, Me.Height - 2)
g.FillPolygon(New SolidBrush(Me.BackColor), p)
End If
Dim s As String = _text(_activeCell)
Dim SF As SizeF = g.MeasureString(s, Me.Font)
Dim r0 As Rectangle
Dim r1 As Rectangle
Select Case _activeCell
Case 1
If _Direction = eDirection.RightUp2LeftDown Then
r1.X = Me.Width - SF.Width - Me.Margin.Right
r1.Y = Me.Height - SF.Height - Me.Margin.Bottom
Else
r1.Y = Me.Width - SF.Height - Me.Margin.Right
r1.X = Me.Margin.Top
End If
Case 0
If _Direction = eDirection.RightUp2LeftDown Then
r0.Y = Me.Margin.Top
r0.X = Me.Margin.Left
Else
r0.Y = Me.Margin.Top
r0.X = Me.Width - Me.Margin.Right - SF.Width
End If
End Select
r0.Width = SF.Width
r0.Height = SF.Height
r1.Width = SF.Width
r1.Height = SF.Height
If _Direction = eDirection.RightUp2LeftDown Then
g.DrawLine(New Pen(_clrDiaLine), Me.Width - 1, 0, 0, Me.Height - 1)
g.DrawString(_text(1), Me.Font, New SolidBrush(_Forecolor1), Me.Margin.Left, Me.Margin.Top)
g.DrawString(_text(0), Me.Font, New SolidBrush(_ForeColor0), Me.Width - g.MeasureString(_text(1), Me.Font).Width - Me.Margin.Right, Me.Height - g.MeasureString(_text(1), Me.Font).Height - Me.Margin.Bottom)
Else
g.DrawLine(New Pen(_clrDiaLine), 0, 0, Me.Width - 1, Me.Height - 1)
g.DrawString(_text(0), Me.Font, New SolidBrush(_ForeColor0), Me.Margin.Left, Me.Height - g.MeasureString(_text(0), Me.Font).Height - Me.Margin.Bottom)
g.DrawString(_text(1), Me.Font, New SolidBrush(_Forecolor1), Me.Width - g.MeasureString(_text(1), Me.Font).Width - Me.Margin.Right, Me.Margin.Top)
End If
If nCel = 0 Then
g.DrawRectangle(New Pen(_clrDiaLine), r0)
If nBlinkOn = 1 Then g.FillRectangle(New SolidBrush(_clrDiaLine), r0)
Else
g.DrawRectangle(New Pen(_clrDiaLine), r1)
If nBlinkOn = 1 Then g.FillRectangle(New SolidBrush(_clrDiaLine), r1)
End If
Return i
End Function
#End Region
End Class
I'm not complete finish but this gives an idee
|
|
|
|
|
Looking good, I guess you're almost done?
Cool
I are troll
|
|
|
|
|
Now comes the big part: reversing the original code (already in vb.net 2003) with normal textboxes into this control
its a competition program AllPlayAll in a scare ex: 15 players agains each other that 225 controls for 30 players thats 900 controls plus all the labels normal textboxes and menus
download Here[^]">
My website
Again thanks for the help
|
|
|
|
|