|
Can you correct this conflict in two methods with similar names but different parameters.
<code>Public Type MyPoint
x As Double
y As Double
End Type
Public Type MyLine
Head As MyPoint
Tail As MyPoint
End Type
Public Sub DrawLine(aLine As MyLine, Canves As Form)
Canves.Line (aLine.Head.x, aLine.Head.y)-(aLine.Tail.x, aLine.Tail.y)
End Sub
Public Sub DrawLine(aLine As MyLine, Canves As PictureBox)
Canves.Line (aLine.Head.x, aLine.Head.y)-(aLine.Tail.x, aLine.Tail.y)
End Sub
</code>
Shoaib Nawaz
|
|
|
|
|
What conflict? What's the errot you're getting?
I see other things wrong that have nothing to do with Overloading, Shadowing, or Overriding.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i have a datagrid on the form..i want that on the button click selected values from the data grid shud be picked up and shud be displayed in the textbox(on the button click)
i know this will be done thru properties...
but i am not able to do so...
please help me out....
please........
ashima
|
|
|
|
|
hi laks here,
iam a beginner to programming field ,i have some doubts
if possible clarify my doubts
1.whether we can convert transfer the records of Ms-excel to Ms-access ,if yes then how we can write a simple application.
2.I want to secure my project.so when ever we install our setup on clients system ,we have to generate one secret code so ,after giving that code the project should be opened
(This should happen when client logs for first time),then we should enter one unique id into the table such that he/she should not install the project on other system
thanks
|
|
|
|
|
Hi,
how can I find Text with specific BackColor in my RTB and replace it with another BackColor? I do not know the Text, Startposition, Length and number of the text pieces with the specific BackColor.
Thanks
Lupus
|
|
|
|
|
I'm new to the VB.NET world so any help will be appreciated. I'm building a Windows app and I have a form with tabs. On the first tab, I'm building a search capability. I have a couple of text boxes and a data grid. Everything seems to work OK, however in my datagrid, one of the columns displays a social security number. My problem is I cant figure out how to format the SSN column to display with dashes. Right now it displays as '#########' and I need it to display "###-##-####'
Thank you in advance for any help.
|
|
|
|
|
LMJ
I'm also a newbie, but have come across this in VS2005. Use the 'Masked Textbox' and specify a mask or 000-00-0000.
If this control is not a part of your version of VS, you can convert the SS number to a string (tostring) and parse it using 'substring'
Dim sParse as String<br />
Dim sSS as String = ""<br />
sParse = iSSnumber.tostring<br />
sSS = sParse.substring(0,3) + "-"<br />
sSS += sParse.substring(3,2) + "-"<br />
sSS += sParse.substring(5,4)
Hope this is right,
Karen
*** Nooobie to OOP and VB.Net 2005
|
|
|
|
|
Take a look at this[^] article here on CP. The code is in C#, but if you look close enough, you'll see that it is easily convertible to VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I've edited the normal.dot file to add certain styles to documents created in Word 2003. These styles would only worked in new documents and not old ones. I created a macro and attached it to a toolbar button, which will add these styles to any documnet whether they are newly created documents or not. Yet my dilemma, is having the styles in this newly created normal.dot file activate no matter who's logged in to the system. I was worndering if there's a Currentuser or username variable that would accomplish this task for me. Any help would be greatly appreciated.
Thank you,
The VB Newbie
|
|
|
|
|
I want to do the following.
I have a tab control with 3 tab pages. When I click on the say tab 1, then a procedure automatically starts.
If I put the procedure in say, TabPage2_Click, then I have to physically click on the tab. What I am aiming for is that when I click the tabPage of the Tab Control, the procedure automatically runs.
I have been trying various ways using TabControl1.TabPages(1) but with no success. I know this must be a simply process and I am missing something out.
|
|
|
|
|
Have you tried combining all the tabpage handlers into one event handler?
See the "Handles" clause at the end of your TabPage_Click event handler. You can add a comma then the next object and event that this code will handle. When any of the classes in the Handles list fire's it's Click event, this handler will be called.
Public Sub TabPage_Click(...,...) Handles TabPage1.Click, TabPage2.Click, TabPage3.Click
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i am a bigginner to this vb.net.i have a problem in inserting data programiticaly(without using wizard or server explorer)from vb.net application to sql data table.whatever i am inserting through vb.net is not updating in the table. i have searched from 2 months for this.please anybody help for this?please give sample code for this, (another question is i am using combo box in the application how to insert that?)
thanking you.
|
|
|
|
|
You posted this very question an hour ago? Don't repost, it's very rude and it won't get your question answered any faster.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Could somebody tells me the way to create string/array math using visual basic? Thank You!
|
|
|
|
|
What do you mean by a "string/array math"? This doesn't make any sense at all, so we couldn't even begin to tell you anything useful.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If you want to know about array of strings
Dim ArrayOfString(0 to 3) as String
Redim Preserver ArrayOfString(5)
ArrayOfString(0)="Put "
ArrayOfString(2)="What "
ArrayOfString(3)="You "
ArrayOfString(4)="to "
ArrayOfString(5)="Save."
Shoaib Nawaz
|
|
|
|
|
hi
i am a bigginner to this vb.net.i have a problem in inserting data programiticaly(without using wizard or server explorer)from vb.net application to sql data table.whatever i am inserting through vb.net is not updating in the table. i have searched from 2 months for this.please anybody help for this?please give sample code for this, (another question is i am using combo box in the application how to insert that?)
thanking you.
shyli
|
|
|
|
|
Without seeing your SQL update code, it's impossible to tell you what your doing wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Imports System.Data.SqlClient
Imports System.Data.DataTable
Imports System.Data.DataRow
Public Class Form1
Inherits System.Windows.Forms.Form
Dim flag As Integer
Dim custid As String
Dim dr As DataRow
Dim dt As DataTable
Dim DS As New DataSet
Dim Conn As SqlConnection = New SqlConnection
Dim CMD As SqlCommand = New SqlCommand
Dim DA As SqlDataAdapter = New SqlDataAdapter
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Conn As SqlConnection = New SqlConnection("workstation Id=SHAily;packet size=4096;integrated security=SSPI; data source=SHAILY; PERSIST SECURITY INFO=FALSE;INITIAL CATALOG=customer")
Dim CMD As SqlCommand = New SqlCommand("select * from tablename ", Conn)
CMD.Connection = Conn
DA.SelectCommand = CMD
DA.Fill(DS, "details")
Textbox1.DataBindings.Add("Text", DS.Tables("tablename"), "CUSTID")
Combobox1.DataSource = DS.Tables("tablename ")
Combobox1.DisplayMember = " tablename "
Combobox1.ValueMember = "NAME"
Textbox2.DataBindings.Add("Text", DS.Tables("tablename “), "ADDRESS")
Textbox3.DataBindings.Add("Text", DS.Tables("tablename "), "PHONE")
Combobox2.DataSource = Ds.Tables("tablename ")
Combobox2.DisplayMember = " tablename "
Combobox2.ValueMember = "POBOX"
End Sub
Private Sub BTNADD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BNADD.Click
dt = DS.Tables("tablename ")
Textbox1.Text = ""
Combobox1.Text = ""
Textbox2.Text = ""
Textbox3.Text = ""
Combobox2.Text = ""
flag = 1
Dim ctr, len As Integer
Dim custidval As String
len = (dt.Rows.Count - 1)
dr = dt.Rows(len)
custid = dr("CUSTID")
custidval = Mid(custid, 2, 3)
ctr = CInt(custidval)
If ctr >= 1 And ctr < 9 Then
ctr = ctr + 1
Textbox1.Text = "C00" & ctr
ElseIf ctr >= 9 And ctr < 99 Then
ctr = ctr + 1
Textbox1.Text = "C0" & ctr
ElseIf ctr >= 99 Then
ctr = ctr + 1
Textbox1.Text = "C" & ctr
End If
Textbox1.Enabled = True
End Sub
Private Sub BtnSAVE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSAVE.Click
If flag = 1 Then
da.Fill(DS, " tablename ")
'Dim dt7 As New DataTable
'dt7 = DS7.Tables("tablename ")
'dr = dt7.NewRow()
'Dim i As Integer
'dr(0) = custid
'dr(1) = Combobox1.Text
' dr(2) = Textbox2.Text
'dr(3) = Textbox3.Text
'dr(4) = Combobox2.Text
' dt7.Rows.Add(dr)
Dim str As String
Dim Conn1 As SqlConnection = New SqlConnection("workstation Id=SHAILY;packet size=4096;integrated security=SSPI; data source=SHAILY; PERSIST SECURITY INFO=FALSE;INITIAL CATALOG=customer")
'CMD.Connection = Conn
str = "INSERT INTO DETAILS '(CUSTID,NAME,ADDRESS,PHONE,POBOX)'+'VALUES(CUSTID,@NAMEBOX,@TBADDRESS,@TBPHONE,@POBOX)'"
Dim CMD1 As New SqlCommand(str, Conn1)
CMD1.Parameters.Add("TEXT", SqlDbType.Char, 8, "custid")
'par.SourceColumn = "custid"
'par.SourceVersion = DataRowVersion.Original
CMD1.Parameters.Add("TEXT", SqlDbType.VarChar, 50, "name")
CMD1.Parameters.Add("TEXT", SqlDbType.VarChar, 90, "address")
CMD1.Parameters.Add("TEXT", SqlDbType.Char, 10, "phone")
CMD1.Parameters.Add("TEXT", SqlDbType.Char, 10, "pobox")
Conn1.Open()
DA.InsertCommand = CMD1
ElseIf flag = 2 Then
DA.Fill(DS, " tablename ")
dt = DS2.Tables("tablename ")
dr = dt.Rows(0)
custid = TEXTBOX1.Text
dr = dt.Rows.Find(custid)
dr.BeginEdit()
dr(0) = custid
dr(1) = COMBOBOX1.Text
dr(2) =TEXTBOX2.Text
dr(3) = TEXTBOX3.Text
dr(4) = COMBOBOX2.Text
dr.EndEdit()
Dim DA As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM tablename", Conn)
DA.UpdateCommand = New SqlCommand("UPDATE tablename SET Name = @Name " & _
"WHERE CUSTID = @CUSTID", Conn)
DA.UpdateCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 15, "Name")
Dim workParm As SqlParameter = DA.UpdateCommand.Parameters.Add("@CUSTID", SqlDbType.Int)
workParm.SourceColumn = "CUSTID"
workParm.SourceVersion = DataRowVersion.Original
Dim DS As DataSet = New DataSet
DS.Fill(DS, "tablename")
Dim cRow As DataRow = DS.Tables("tablename").Rows(0)
cRow("Name") = "New name"
End If
flag = 0
DA.Update(DS, "tablename")
DA.fill(DS,”tablename”)
MsgBox("data saved---")
End Sub
|
|
|
|
|
Hi All,
I need to show all the menu items in the form into treeview
but i am not able to get the menu name its only giving the
menu text. any methods are available to get the name of the
menuitem object.
reply me yaar!!
V.Gopi.
Easy Design Systems
Coimbatore
India
|
|
|
|
|
Are you sure there's no name property (I don't remember it by heart)?
Anyway, an easy way is give the tag property the same value of the name and recall that one.
|
|
|
|
|
Hi all,
can any one quickly tell me how can i change my button with an image of my choice and also to play a sound on mouse click and mouse over.
replies could be send directly to my email address described below.
Jennifer Wadhani
jenniferaahmed@yahoo.com
|
|
|
|
|
Hello
For changing the button picture you need to drag an imagelist on the form. Add as many images as you like in the imagelist. Now to show any image on the button you need to select the imagelist in button's 'imagelist' property. Now all the images you ve added in the imagelist are visible to your button. Use 'ImageIndex' property of the button to change the images.
_mubashir
|
|
|
|
|
For playing sound...use the following
Public Const SND_ASYNC = &H1 ' play asynchronously
Public Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Public Const SND_NOSTOP = &H10 ' don't stop any currently playing sound
Public Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
' Use the following library
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
' call
PlaySound("FilePath And Name", 0, SND_NOSTOP)
_mubashir
|
|
|
|
|
Thanks mubashir, i will try n get bac to u, Thanks a lot dear to show ur concern.
Regards
Jennifer Wadhani
jenniferaahmed@yahoo.com
|
|
|
|
|