|
I need to add the button of a datagrid column Can anyone guide me as to how this is done.
aayush singh
|
|
|
|
|
<br />
Option Strict Off<br />
Option Explicit On <br />
<br />
Imports System<br />
Imports System.ComponentModel<br />
Imports System.Drawing<br />
Imports System.Windows.Forms<br />
<br />
Public Class DataGridButtonColumn<br />
Inherits DataGridTextBoxColumn<br />
Public Event ButtonClicked(ByVal rowNumber As Integer)<br />
Public WithEvents btn As New Button<br />
Dim xReadOnly As Boolean = False<br />
Public Property _ReadOnly() As Boolean<br />
Get<br />
Return xReadOnly<br />
End Get<br />
Set(ByVal Value As Boolean)<br />
xReadOnly = Value<br />
End Set<br />
End Property<br />
Public Sub New()<br />
Me.TextBox.Visible = False<br />
Me.TextBox.Cursor = Cursors.Hand<br />
btn.FlatStyle = FlatStyle.System<br />
btn.ForeColor = Color.Red<br />
btn.Cursor = Cursors.Hand<br />
btn.Text = "SİL"<br />
End Sub 'New<br />
Dim _rowNum As Integer<br />
<br />
Protected Overloads Overrides Sub Edit(ByVal [source] As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal bounds As System.Drawing.Rectangle, ByVal [readOnly] As Boolean, ByVal instantText As String, ByVal cellIsVisible As Boolean)<br />
Try<br />
MyBase.Edit([source], rowNum, bounds, [readOnly], instantText, cellIsVisible)<br />
_rowNum = rowNum<br />
btn.Parent = Me.TextBox.Parent<br />
btn.Location = Me.TextBox.Location<br />
btn.Size = New Size(Me.TextBox.Size.Width, TextBox.Size.Height)<br />
btn.Text = "SİL"<br />
btn.Visible = True<br />
btn.BringToFront()<br />
btn.Focus()<br />
Catch ex As Exception<br />
Throw ex<br />
End Try<br />
End Sub 'Edit<br />
Protected Overrides Function Commit(ByVal dataSource As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer) As Boolean<br />
'btn.Visible = False<br />
Return True<br />
End Function 'Commit<br />
Private Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click<br />
If Not xReadOnly Then<br />
RaiseEvent ButtonClicked(_rowNum)<br />
End If<br />
End Sub<br />
<br />
End Class<br />
<br />
|
|
|
|
|
Hi all,
Any help would be greatly appreciated.
I was wondering if there is any way to catch every unhandled error in an application so that the program can then perform some exit tasks before crashing out no matter what the error is. Is this possible?
I have tried the API SetUnhandledException but this doesn't seem to do it. Maybe i'm doing it wrong.
I have also scoured the internet and have tried the examples i felt were relevant but none seem to be able to provide what i want.
Please advise if you can.
This is VB6 by the way.
Thanks in advance.
"If i was king cigarettes would be free."
-- modified at 6:08 Friday 7th April, 2006
|
|
|
|
|
Hi,there guyz.I'm currently working on a project that requires the following-:
on a click of a button a report is created reflecting what is on the form currently,i.e the program should create reports at runtime
I tried the usual way by using data environment connecting to data reports but that only creates reports based on the data on the database(old data)and not the current data (data on the form when at runtime)
Your responsibility determines your authority which in turn specifies your teritory
|
|
|
|
|
IN A MDI PROJECT I WANNA USE "WINDOWS" MENU. BUT I DONT KNOW HOW TO LIST OPEN WINDOWS AT LIST AT VS.2005 ? IT WAS BUILT IN PROPERTY AT V.S.NET 2002
|
|
|
|
|
Create a Window Menu. Select the Menu Strip, Set its MdiWindowListItem property to your Window menu
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
WHAT A STUPID ME
|
|
|
|
|
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
Hi Chatura,
asl plz.
Nice signatures. Our football coach also says the same,
" All ur mistakes r forgived, but none of the mistake should be repeated. "
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
I need to export the contents of a datagrid to csv. Can anyone guide me as to how this is done.
With Best Regards,
Mayur
|
|
|
|
|
it was a simple search at google,
1. open a new web page
2. write "www.google.com" to address bar
3. Click "Go" button (it is at right)
4. Then softly click to first result of returned by google.
5. You see "http://www.codeproject.com/csharp/export2excel.asp[^]"
|
|
|
|
|
Hi all
I need do the following based on Boolean Algebra
ex 1. (M271/M272/M651)+(450/965)/M642/M646
All possible result
M271 + 450
M271 + 965
M272 + 450
M272 + 965
M651 + 450
M651 + 965
M642
M646
ex 2 M271/M646+M006/M651+M013
M271 + M006 + M013
M646 + M006 + M013
M271 + M651 + M013
M646 + M651 + M013
Do somebody no where I can find a code library or code to help
me to break up any Boolean Algebra expression into all possible result
Thanks in advance
PS. I also have more complex expression
|
|
|
|
|
Is this possible? I have some funky graphics, but if I have to put them onto a button as an image then they will go a bit wonky. So I basically want is to display the images just as images, but to have a button that will be invisible overlayed on top of it but still clickable. Thus adding the effect of it being a normal button.
Cheers.
|
|
|
|
|
how can i use gridview control to edit & delete records in vb.net.
my grid can show the data but i want to add these functionality too.
please help me.
byeeeeee
|
|
|
|
|
can someone help me! i know that this is not a laptop forum but i have a laptop siemens and he went standby after 5 mins because i didn't move the mouse. how can i bring him back to normal pls?
Thanks for any help
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Correct place-forum for your problem is OS/SysAdmin.
Check properties of your PowerAdapter in Control Panel
|
|
|
|
|
Hi,
I need to call a dll function but have no idea how to declare the function in VB.NET
In the .h file, it is declare as follows:
int CALLBACK gscBsiGcReadTagList(
IN UTILCardHandle hCard,
IN unsigned char* usAID,
IN unsigned int unAIDLen,
OUT GCTag* pTagArray,
INOUT unsigned int* pnTagNb
);
In the C sample code, it is called as follows
void CreateDataInContainer()
{
long lResp = BSI_OK;
unsigned char usAID[BUFSIZ];
unsigned int unAIDLen=0;
char szLecture[BUFSIZ];
GCTag ucTag=0;
unsigned int unTag=1;
unsigned char usValue[500];
unsigned int unValueLen=0;
printf ("\ngscBsiGcDataCreate");
unAIDLen = sizeof (usAID);
GetContainerAID ( usAID, &unAIDLen);
GetString ("\nEnter Tag", szLecture, sizeof (szLecture));
sscanf (szLecture, "%d", &unTag);
ucTag = (char)unTag;
GetString ("\nEnter Data Value ", szLecture, sizeof (szLecture));
strcpy ((char *)usValue, szLecture);
unValueLen = strlen (szLecture);
printf("\nSize of value=%d",unValueLen);
lResp = gscBsiGcDataCreate(
hCard,
usAID,
unAIDLen,
ucTag,
usValue,
unValueLen
);
if (lResp != BSI_OK)
{
DisplayError(" ... ", lResp);
}
else
{
printf ("\n ... OK\n");
}
}
So, can anyone help me with the declaration and calling in VB.NET?
Thanks!
Chen Wu
-- modified at 1:33 Friday 7th April, 2006
|
|
|
|
|
hi
i m making a project could u help me.
i want guidance.......
i have to make a CategoryMaster form in which every cateory have a Image.
& this point is confusing me.
how i will display the image dynmically...& in which control.....
because i have to display these images in 4* 4 matrix.
please give some suggestion.
|
|
|
|
|
You can put them in a picture box or paint them direct to the form.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi
i'm storing these images in database actually these images are temlates so they have there own discription & price etc.
when i store the file name into the databse how ould i cal them.
please explain litte more
|
|
|
|
|
Is this VB6 or VB.NET?
"If i was king cigarettes would be free."
|
|
|
|
|
Hi All,
the tool i am using is mycos web chart and i have no idea how this chart renders the data.
here are my codes.
------
Try
'select the table with only distinct ID based
cmd = New SqlCommand("select distinct measure_id from measuredata m, textdata t where t.ScoreCardId = m.ScoreCardId", objConn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dtId As New DataTable("MeasureId")
da.Fill(dtId)
'select all columns with ID
Dim cmd1 As SqlCommand = New SqlCommand("select * from measureData", objConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd1)
Dim dt As New DataTable("MeasureSource")
da1.Fill(dt)
Dim datarow As DataRow
For Each datarow In dtId.Rows
Dim myView As New DataView(dt)
Dim chart As New Mycos.MycosChartWeb
chart.ID = "chart" + dtId.ToString
myView.RowFilter = String.Format("Measure_Id='{0}'", datarow.Item("measure_Id"))
chart.DataSource = myView
chart.DataBind()
PlaceHolder1.Controls.Add(chart)
Next datarow
Catch ex As Exception
Response.Write("OOPs what went wrong:" + ex.ToString)
Finally
End Try
------
Now my problem is how to add data to those dynamically generated charts. i also need to assign the ID for each chart. how do i do that. and also i want those charts to displayed in specific area but not one by one in for loop. i dont know if anyone of you have done this. well if you have please help me
thanks
|
|
|
|
|
Is it possible to set the computer to hibernate rather than just turn off using VB?
many thanks
|
|
|
|
|
|
what details are avaliable about a web page when loaded up by VB? can you find the number of images on the page? I am new to non - excel/project VB code & would like to learn about some of the functionalities.
Many Thanks Guys
|
|
|
|