I tried to add if function but it doesn't work with me the code without if function work prefect
PrivateSub Table1DataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Table1DataGridView.CellContentClick
'Declare a couple of variables to hold the row number and contents of the third cellDim pRowNo AsIntegerDim pstrContents AsString'Get the ROW number
pRowNo = Val(Table1DataGridView.SelectedCells(0).RowIndex.ToString())
' here I try to add ifIf Table1DataGridView.Rows(pRowNo).Cells(0).Value = TrueThen'It's here where you test if Cell 0 is checked, then if so the remainder (below) is actioned.' If Table1DataGridView.Rows(0).Cells(0).Value = True Then'Store contents of cell three
pstrContents = Table1DataGridView.Rows(pRowNo).Cells(2).Value
'Insert contents into cell two
Table1DataGridView.Rows(pRowNo).Cells(1).Value = pstrContents
Table1DataGridView.Rows(pRowNo).Cells(1).Value = ""EndIfEndSub
I need to add if because once cell 0 checked= false then cell1 = clear or "" empty
I loaded the code below and it works, it's a little simplistic however by playing around with it I'm sure you can improve your skills by making adjustments.
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.Click
Dim pRowNo As Integer
pRowNo = Val(DataGridView1.SelectedCells(0).RowIndex.ToString())
If DataGridView1.Rows(pRowNo).Cells(0).Value = 1 Then
DataGridView1.Rows(pRowNo).Cells(1).Value = DataGridView1.Rows(pRowNo).Cells(2).Value
DataGridView1.Rows(pRowNo).Cells(1).Value = ""
ooowwhh.. so how i could write the code to show that all .. actually i know i can use & vbcrlf & "something" something like that...
but my problem is i dont know how to display as this line as you can see on my code before:
"Seat booked: " & splitword(i).tostring
where i = 1 ,2 ,3 and until some number depends on the word count.
for know i only can show only for splitword(1).
i use txtsms.text = txtsms.text & "seat booked: " & splitword(i) but the text "seat booked" also repeated.. so what is the correct code to write??
Someone else gave you the answer. But, the underlying problem still remains. The problem you ran into a a copmlete lack of experience and very basic knowledge of VB.NET (or any other language). I seriously recommend picking up a beginners book on VB.NET and working through it.
Unable to cast from a number, the value must be less that infinity.
My code in vb .net visual studio 11
Me.Client = New DXProf(Me) --Excetion thrown here---
Me.components = New Container
Dim manager As New ComponentResourceManager(GetType(Form1))
DXFramework.m_Icon = DirectCast(manager.GetObject("$this.Icon"), Icon)
Here is the exception detail.
Message=Unable to cast object of type 'DXProf' to type 'idt.medical.IDXClient'.
at DXPro.Form1.Form1_Load(Object sender, EventArgs e) in C:\VBDXDCURRENT\Functionional No Errors\DXPro\Form1.vb:line 73
From this, and your other responses, I get the feeling you do not really understand inheritance and still have no idea what this error is about. You need to look at your class definitions to see why the two are incompatible.
Programming is work, it isn't finger painting.Luc Pattyn
In case that it was you (or someone of your colleagues) to develop that DXProf component, make sure that it inherits from 'idt.medical.IDXClient' (which might be an interface).
Actually I'd expect the compiler to complain - is there still some kind of "Option Explicit Off" in that version of VB?
Thanks for the info, I am the only one working on this project, the last developer and creator is no longer with us. I having to reconstruct everything with so so source code and no comments or documents to speak of.
In vb 2008 and version 11 there is a few choices of option explicit, so yes I could turn it off. There is also option strict which can be toggled off too.
Now you said to make sure that the DXProf component inherits from idt.medical.IDXClient. Could you give me an example. Yes you are right idt.medical.IDXClient is an interface.
Please help if you can.
Last Visit: 31-Dec-99 19:00 Last Update: 3-Feb-23 10:18