|
Good Morning alzaabi20xx
for your Button First enter the following code
Private Sub cmdfirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdfirst.Click
'Move to the First Record
Try
Me.BindingContext(DataSet11, "Property").Position = 0
Catch ex As OleDb.OleDbException
MessageBox.Show("Canot Navigate, Because the is no Connection to the Server", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
End Sub
For your Button Previous
Private Sub cmdprevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdprevious.Click
''' This will obviously point to the Previous record of the Dataset
Try
Me.BindingContext(DataSet11, "table").Position -= 1
Catch ex ex As OleDb.OleDbException
MessageBox.Show("Canot Navigate, Because the is no Connection to the Server", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
End Sub
For Button Next
'''Display Next Record
''' This will obviously point to the Next record of the Dataset
Try
Me.BindingContext(DataSet11, "property").Position += 1
Catch ex As OleDb.OleDbExceptionn
MessageBox.Show(ex.Message)
End Try
For Button Last
'move to the last Record
Try
With Me.BindingContext(DataSet11, "property")
.Position = .Count - 1
End With
Catch ex As OleDb.OleDbExceptionn
MessageBox.Show(ex.message)
End Try
For your update Button
SqlDataAdapter1.Update(DataSet11, "Property")
PLease modity this code according to your datasource. try to catch the Errors and display system Errors not your your Errors messages on the Messagebox,and that will be until you finish your Delopment. after that you can make Errors that users can understand. Contact me through E-mail vuyiswam@tshwane.gov.za because i might be codeProject the whole of today.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
|
|
|
|
|
Hello again Mr Vuyiswa Maseko
I'm really happy that you still patient with me...
i put all codes of the buttons and no error show to me, but i have a question if you don't mind.
Q) you wrote the following code:
Me.BindingContext(DataSet11, "property").Position += 1
"property" what is it & what should i wrote instead of it...
and thank you again for your time..
ok that's cool
|
|
|
|
|
Good Afternoon Mr alzaabi20xx
"property" is the Name of your table that you want to navigate through it, but in your case use the nameof the Relationship. remember.
alzaabi20xx our thread is becoming to long in this topic, i suggest you start contacting me on the e-mail i gave you.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
|
|
|
|
|
Well, i have a SWF (not mine) that shows a city map. I use SWF Decompiler to see some code inside it and i can use some of it.. some example is :
Flash1.SetVariable "_yscale", 120
Well, now, when i move the scale from 100% to 120% or more i need to drag it and that way i can see some areas..
The problem here is that i can't found the way to invoke the startDrag event indide SWF file
The Action Script says this :
on (press)<br />
{<br />
startDrag ("_root.mapa", false);<br />
}
I don't need to drag the ShockWave Flash Object, i need to drag the picture inside it
Can somebody help me in this ?
|
|
|
|
|
Considering this has absolutely nothing to do with VB.NET, no.
|
|
|
|
|
Hello everyone,
Can anybody help me how to access public folders on exchange server.
For example 'Public Folder/All Public Folders/Email/2007/January/Sales/..
In my application I have a requirement to automatically file email messages and attachments.
Thanks
Nas
|
|
|
|
|
Hi,
I am trying to make a custom search function for the web browser control. It works fine with single frame pages, but on pages with multiple frames such as wikipedia articles, I need to get the outermost document. I am unable to do that. Here is my code:
Dim htmldom As MSHTML.IHTMLDocument2 = CType(wBrowser.Document.DomDocument, MSHTML.IHTMLDocument2)
Dim outerMostElement As IHTMLElement
Dim doc As IHTMLDocument2 = DirectCast(wBrowser.Document.DomDocument, IHTMLDocument2)
If wBrowser.Document.Body.Parent.ClientRectangle.IsEmpty Then
outerMostElement = doc.body
Else
outerMostElement = doc.body.parentElement
End If
'Create the range
Dim range1 As MSHTML.IHTMLTxtRange = DirectCast(DirectCast(outerMostElement, MSHTML.IHTMLBodyElement).createTextRange(), MSHTML.IHTMLTxtRange)
'CType(htmldom.selection.createRange(), MSHTML.IHTMLTxtRange)
'Get the initial start point of the text range
If range1.text.Substring(myIndex).IndexOf(wordToFind) <> -1 Then
myIndex = range1.text.Substring(myIndex).IndexOf(wordToFind) + myIndex
range1.moveStart("character", myIndex)
frmSearch.Hide()
Me.Activate()
range1.findText(wordToFind, 0, 0)
range1.select()
'set the start position of the range for te next try
myIndex += wordToFind.Length
range1.collapse()
Return myIndex
Else
Return -1
End If
It gives a com casting error on pages such as wikipedia as its unable to cast doc.body.parentElement. Whats the solution to this?
Thanks in advance,
Ahmad
|
|
|
|
|
Hi. I'm trying to find out how I can select a row in a datgrid and allow my various textboxes and listboxes corresponding to the fields in the datagridview, to display the data within that row. the user then must be able to edit the data in the textboxes and the new dat should be shown in the database and when i call a procedure to save the data the new data must be stored in the dataset and the database updated. I'm sure I just need to right the code in a click event for the datagrid. the problem is which one do i use? is this how i do it? Please help(im using vb.net 2005)
Mr Oizo
|
|
|
|
|
you have to set textbox, combo box and other object datasource same as your datagridview datasoure.. and set there text value using there property...
use datagridview.columns(0).selected = true for selecting a row...
set multiselect to false to avoid multiselection...
|
|
|
|
|
hi
i am working on my assingment about pong game and it's almost done but i just want to provide control option for user so they can select their choice for control keys to control right and left paddle
so i have use module to pass the info. for another form but it's not working, so can anybody help me with this
'''
this is the code for module
<br />
Module Module1<br />
Public MyKeys(4) As Keys<br />
<br />
Public Sub main()<br />
Dim MyForm1 As New frmStart<br />
MyForm1.Show()<br />
Application.Run()<br />
End Sub<br />
End Module
'''''
this is for form load
Private Sub frmStart_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
cboKey1.Items.Add(Keys.Up)<br />
cboKey1.Items.Add(Keys.Down)<br />
cboKey1.Items.Add(Keys.Right)<br />
cboKey1.Items.Add(Keys.Left)<br />
cboKey1.Items.Add(Keys.A)<br />
cboKey1.Items.Add(Keys.Z)<br />
cboKey1.Items.Add(Keys.K)<br />
cboKey1.Items.Add(Keys.M)<br />
cboKey1.Items.Add(Keys.S)<br />
cboKey1.Items.Add(Keys.X)<br />
cboKey1.SelectedIndex = 0<br />
For I As Integer = 0 To cboKey1.Items.Count - 1<br />
cboKey2.Items.Add(cboKey1.Items.Item(I))<br />
cboKey3.Items.Add(cboKey1.Items.Item(I))<br />
cboKey4.Items.Add(cboKey1.Items.Item(I))<br />
<br />
Next<br />
cboKey2.SelectedIndex = 0<br />
cboKey3.SelectedIndex = 0<br />
cboKey4.SelectedIndex = 0<br />
MyKeys(1) = cboKey1.SelectedItem<br />
MyKeys(2) = cboKey2.SelectedItem<br />
MyKeys(3) = cboKey3.SelectedItem<br />
MyKeys(4) = cboKey4.SelectedItem<br />
Timer1.Enabled = True<br />
End Sub '''
and this code is for keydown event for another form
Private Sub frmPong_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown<br />
For J As Integer = 1 To 4<br />
Select Case MyKeys(J)<br />
Case MyKeys(1)<br />
MyBat1.Y -= 10<br />
Case MyKeys(2)<br />
MyBat1.Y += 10<br />
Case MyKeys(3)<br />
MyBat2.Y -= 10<br />
Case MyKeys(4)<br />
MyBat2.Y += 10<br />
End Select<br />
Next<br />
End Sub '''''
and code for button click
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim MyForm As New frmPong<br />
MyForm.Show()<br />
MyKeys(1) = cboKey1.SelectedIndex<br />
MyKeys(2) = cboKey2.SelectedIndex<br />
MyKeys(3) = cboKey3.SelectedIndex<br />
MyKeys(4) = cboKey4.SelectedIndex<br />
Me.Hide()<br />
End Sub
'
'
so when application start the first form shows option for user and when user click buttton it's load selected controls for user
that's the hole idea
please help me with this problem
please please please
|
|
|
|
|
first of all u hv to add a items in combobox if u want to retrieve the data in second form of combobox
then write code
firstform.combobox.items()
or
save the data in database table n retrive in combobox
oke
hope u understand
byeeeeee
lucky
|
|
|
|
|
hi everyone,
i want to know whether there r any method or Trick to replace multiple spaces with single space.Let me explain
i load a text file in richtextbox.This file contain a number of lines. Now within two words of a single line there are single space(mean space(1)),double space(mean space(2)),tripple space(mean space(3)).... multiple space(mean space(n)). Now i want to Replace all occurence of multiple type of Space with Single space.
I think i properly told my problem.
anybody have idea what should i do?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
hi,
May be My Article[^] will help you if you do not found a correct solution, but you will have to change it little bit.
Chatura Dilan
|
|
|
|
|
Hi,
remark: I will use - to indicate a space
1. in a string s the statement s=s.Replace("--","-") would replace every pair
of spaces by a single space; so 7 spaces would become 4 spaces.
2. if you redo step 1 the number of spaces would be further reduced; you could loop over 1.
until the length of s no longer changes.
3. you can apply the above to myRichTextBox.Rtf
With the above, you would have fewer than 10 lines of code to remove all multiple spaces.
BTW: if you want to leave double spaces as is, replace step 1 by s=s.Replace("---","--")
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello,
I've got some questions about a combobox and a listbox:
- First: I want the value of the selected item in a combobox / listbox, how do I that. It is not with me.combobox.valuemember, but what is the correct code of it?
- Then: If the focus is on the combobox, I want the combobox is dropped down, so that I don't have to click on the combobox to drop down all the choises.
- Next: If I save all the values of the fields on a form, then I clean all the fields with: me.textbox.text = "", but how does I do that with a combobox / listbox?
|
|
|
|
|
hi xebe'
First: I want the value of the selected item in a combobox / listbox, how do I that. It is not with me.combobox.valuemember, but what is the correct code of it?
use following statement
dim str as string<br />
dim id as string<br />
str=combobox1.selectedItem<br />
id=combobox1.selectedValue
Next: If I save all the values of the fields on a form, then I clean all the fields with: me.textbox.text = "", but how does I do that with a combobox / listbox?
use for Each loop for clean all textbox,ComboBox,ListBox
Dim a As New System.Windows.Forms.Control<br />
For Each a In me.Controls<br />
If TypeOf a Is TextBox Then<br />
a.Text=""<br />
elseif TypeOf a Is ComboBox then<br />
a.selectedIndex=-1<br />
elseif TypeOf a Is ListBox then<br />
a.selectedIndex=-1<br />
<br />
End If<br />
Next
Hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Thank you very much, but I still don't know when the focus is on a combobox, how I must program that the combobox is already drop down and that I or a user should press the combobox button to be dropped down, hope someone can help me...
Also the combobox is still filled with the value I have entered in the field, so the code of
<br />
elseif TypeOf a Is ComboBox then<br />
a.selectedIndex=-1<br />
doesn't work.
Hope you can help me...
|
|
|
|
|
Also the combobox is still filled with the value I have entered in the field, so the code of
elseif TypeOf a Is ComboBox then
a.selectedIndex=-1
doesn't work.
use one more statement after statement(a.selectedIndex=-1)
a.text=""
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
user...
me.combobox.selectedvalue..... in getting the value...
and use
me.combobox.clear... to remove all data in it...
|
|
|
|
|
hi,
I mean you need to get combobox with select:
If u hv 'Select' item in combo with text 'Select' and its value '0' then
write :
Combobox1.selectedIndex=0
|
|
|
|
|
hi all...
we are using cmb1.findString("jj") method to find a text(display member) in the combobox .. like this i want to search a value member in a combobox... does any 1 have idea...
cheers..
|
|
|
|
|
YOu may need to iterate and compare through the Items collection right?
|
|
|
|
|
i cant run my program, there's an error:
Type 'BOOK_Locator.Dataset1' is not declared
in codes:
Friend WithEvents DataSet11 As BOOK_LOCATOR.DataSet1
i have connected my database in connection wizard properly but why there's an error in it? how can i fix?
|
|
|
|
|
Don't cross post.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi and good evening everybody i am fairly knew to vb.net and i have only just ventured into including xml files into my applications what i need help with is how would i be able to count how many lines there are between each parent node for example( what i will be using in my app )
<code><command>
<out>
<out>
<out>
<out>
</command></code>
but how would i be able to count how many <out>'s there are between the <command>'s and be able to use the line numbers else where in my application.
All help is great help no matter how small i just need a gentle push in the right direction.
Thanks
MrScruff
Trouser Jazz, Get A Move On Keep It Solid Steel
|
|
|
|