Click here to Skip to main content
15,923,051 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How do I switch between forms by hiding the other Pin
Anonymous14-Apr-05 10:07
Anonymous14-Apr-05 10:07 
GeneralRe: How do I switch between forms by hiding the other Pin
DevQuest14-Apr-05 11:22
DevQuest14-Apr-05 11:22 
GeneralRe: How do I switch between forms by hiding the other Pin
Mitch F.14-Apr-05 14:24
Mitch F.14-Apr-05 14:24 
AnswerRe: How do I switch between forms by hiding the other Pin
rhenerlau19-Apr-05 17:19
rhenerlau19-Apr-05 17:19 
GeneralCrystal Report TextObject Pin
dpagka14-Apr-05 5:15
dpagka14-Apr-05 5:15 
Generalimage button Pin
Lisana14-Apr-05 3:18
Lisana14-Apr-05 3:18 
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 4:15
mveDave Kreskowiak14-Apr-05 4:15 
GeneralRe: image button Pin
Lisana14-Apr-05 5:44
Lisana14-Apr-05 5:44 
Thanks..that's so helpful...

I have another issue in my vb app. here is my coding:

private function contactView()

'connect to data and do the query.....
'user the DataReader to read the value from the query...
'Query: SELECT primary_contact, entity_id from Conatcts

Do While DR.Read()
primaryContact = DR.GetBoolean(0)
entity = DR.GetInt32(1)
'creat a image button
If primaryContact = True Then
Dim aImageButton As New Button
With aImageButton
Dim imagePath As String = Path.Combine(Application.StartupPath, "checkbox_checked.gif")
.Image = Image.FromFile(imagePath)
.Name = entity
.Text = ""
.ImageAlign = ContentAlignment.MiddleCenter
.FlatStyle = FlatStyle.Flat
.Location = New Point(10, y)
.Width = 20
.Height = 20
End With
' Attach the Click Event handler
AddHandler aImageButton.Click, AddressOf ImageButtonclickHandler
' Finally, add the control to the Form
tpgContact.Controls.Add(aImageButton)
Else
Dim aImageButton As New Button
With aImageButton
Dim imagePath As String = Path.Combine(Application.StartupPath, "checkbox_blank.gif")
.Image = Image.FromFile(imagePath)
.Name = entity
.Text = ""
.ImageAlign = ContentAlignment.MiddleCenter
.FlatStyle = FlatStyle.Flat
.Location = New Point(10, y)
.Width = 20
.Height = 20
End With
' Attach the Click Event handler
AddHandler aImageButton.Click, AddressOf ImageButtonclickHandler
' Finally, add the control to the Form
tpgContact.Controls.Add(aImageButton)
End If
y += 25
Loop
end function

Public Sub ImageButton1ClickHandler(ByVal sender As Object, ByVal e As System.EventArgs)

results = CType(CType(sender, Button).Name, Int32)
Dim DA As New OleDbDataAdapter
objConn.Open()
DA.SelectCommand = New OleDbCommand
DA.SelectCommand.Connection = objConn
DA.SelectCommand.CommandType = CommandType.Text
DA.SelectCommand.CommandText = "UPDATE Contacts set primary_contact = 0 WHERE client_entity_id = " & client_entityID
DA.SelectCommand.ExecuteNonQuery()

Dim DA2 As New OleDbDataAdapter
DA2.SelectCommand = New OleDbCommand
DA2.SelectCommand.Connection = objConn
DA2.SelectCommand.CommandType = CommandType.Text
DA2.SelectCommand.CommandText = "UPDATE Contacts set primary_contact = 1 WHERE entity_id = " & results
DA2.SelectCommand.ExecuteNonQuery()

objConn.Close()
End Sub

---here is my problems, after the click, I want to rebind the data, so the form will show up the change, I can't recall the function in the ImageButton1ClickHandler, what should I do?

Lisa
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 5:56
mveDave Kreskowiak14-Apr-05 5:56 
GeneralRe: image button Pin
Lisana14-Apr-05 6:07
Lisana14-Apr-05 6:07 
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 6:13
mveDave Kreskowiak14-Apr-05 6:13 
GeneralRe: image button Pin
Lisana14-Apr-05 6:17
Lisana14-Apr-05 6:17 
GeneralRe: image button Pin
Dave Kreskowiak14-Apr-05 8:17
mveDave Kreskowiak14-Apr-05 8:17 
GeneralRe: image button Pin
Lisana14-Apr-05 9:16
Lisana14-Apr-05 9:16 
GeneralRe: image button Pin
rwestgraham14-Apr-05 10:07
rwestgraham14-Apr-05 10:07 
GeneralRe: image button Pin
Lisana14-Apr-05 10:41
Lisana14-Apr-05 10:41 
GeneralRe: image button Pin
Dave Kreskowiak15-Apr-05 3:33
mveDave Kreskowiak15-Apr-05 3:33 
GeneralRe: image button Pin
Lisana15-Apr-05 3:42
Lisana15-Apr-05 3:42 
GeneralRe: image button Pin
Lisana14-Apr-05 6:19
Lisana14-Apr-05 6:19 
GeneralRe: image button Pin
rwestgraham14-Apr-05 9:47
rwestgraham14-Apr-05 9:47 
GeneralUsing Wavelet in VB Pin
Anonymous14-Apr-05 2:25
Anonymous14-Apr-05 2:25 
GeneralRe: Using Wavelet in VB Pin
Dave Kreskowiak14-Apr-05 3:49
mveDave Kreskowiak14-Apr-05 3:49 
GeneralHighlighting Datagrid specific items Pin
bibipopopopo14-Apr-05 1:26
bibipopopopo14-Apr-05 1:26 
GeneralRe: Highlighting Datagrid specific items Pin
Dave Kreskowiak14-Apr-05 3:45
mveDave Kreskowiak14-Apr-05 3:45 
GeneralMS chart control Pin
Mr Dabbah13-Apr-05 22:57
Mr Dabbah13-Apr-05 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.