|
I crated a datagrid and I program the DataGridTableStyle in code for the datagrid to set the display format. I also have a delete button on the form. The problem is a ghost graphics of the selected cell is left behind after the row in the datagrid has been deleted.
I will explain:
1. I initially display all the rows in the datagrid
2. I click on a cell (4,1) for that row to be deleted
3. I click on the delete button which deletes the row/record from the db and reloads the dataset and the datagrid with the updated information
4. When the datagrid is repopulated, there are only 3 rows (this is correct), but the selected cell (4,1) is still showing on the grid. The rest of the data for row 4 is gone. Just that single cell is still showing.
I have tried clearing out the table styles, but that did not work. Any suggestions?
Thanks in advanced
Jeffrey
|
|
|
|
|
|
Hi !. Thank you all in advance for any help, advice.
I would like to develop a small tool which will let me browse a fixed directory/folder and open files(.XLs, .snp, .doc, etc)
The tools itself will just let browse a folder and and selecta file to be opened using its default program(.doc will open in word, .snp will open in snap hot viewer).
Basically I am looking for ideas on how start on this using vb.net.
Thanks
|
|
|
|
|
Can some one help me get started???
|
|
|
|
|
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2224&lngWId=10
|
|
|
|
|
|
Hi All,
I have created a module using ArrayList to store my custom structure type as below codes. How can I search the this ArrayList with my custom structure ?
Public Structure MyStru
UserID As String
Name As String
Class As String
End Structure
Sub Main
Dim MyClass As New ArrayList()
Dim MyStudent As New MyStru
MyStudent.UserID = "ID001"
MyStudent.Name = "Peter Pan"
MyStudent.Class = "2C"
MyClass.Add(MyStudent)
************************************************
Suppose hereafter I have many student records need to be
inputted into MyClass. And I want to check for any duplication on
the member MyStudent.UserID from MyClass. How can I do that ??
As I know, there is a method Contains in ArrayList(), but what I can
find from the Internet is the sample of using String not Custom
Structure.
End Sub
Thanks for your professional help.
FM_668
|
|
|
|
|
Hi;
This is not as big of a problem as you may think. This is what is needed to be done.
Create you structure as follows:
Structure MyStru
Implements IComparable
Public UserID As String
Public Name As String
Public StuClass As String
Public Function CompareTo(ByVal obj As Object) _
As Integer Implements System.IComparable.CompareTo
Dim tmpObj As MyStru
tmpObj = CType(obj, MyStru)
Return Me.UserID.CompareTo(tmpObj.UserID)
End Function
End Structure
Dim MyStuClass As New ArrayList
Dim MyStudent As New MyStru
By defining “Implements IComparable” and implementing the function CompareTo in your structure, when you now call ArrayList.Sort and ArrayList.BinarySearch, your CompareTo function will be called. Because you know the structure and know how you want to sort and search the objects you pass those items to the system which knows how to compare the strings. The Me.UserID in the return statement above is the first string to compare to the tempObj.UserID the other string which ArrayList.Sort or ArrayList.BinarySearch sent to compare.
Before you can call ArrayList.BinarySearch the object must be sorted, the ArrayList.Sort will do that for you.
And now the rest of the code:
‘ Call sort before calling MyStuClass.BinarySearch
MyStuClass.Sort()
' The index into the ArrayList where it
‘ found the record you wanted.
Dim index As Integer
‘ Holds the item you are searching for.
Dim tmpStru As New MyStru
tmpStru.UserID = txtFind.Text.ToString()
index = MyStuClass.BinarySearch(tmpStru)
The value of index will be a negative number meaning it was not found or a positive number meaning the zero based index of the value you were looking for in your arraylist.
Hope this was of some help.
|
|
|
|
|
Thanks Very Much
|
|
|
|
|
Hello There
I have a textbox and when I make the border style flat then a black line comes around it. I want to change the color of that line. can Any one knows how to ?
also if I want to change the color to any custom color from Hexadecimal then how to do that ?
|
|
|
|
|
Im not sure how you would do that but i do know of a method that would work
for putting a border of any color or thickness around a textbox.
I would use labels to draw lines and form a box around the textbox.
Select label, draw the label thin like a line.
set these properties
Text = (Nothing)
BackColor = Desired Color
Size = This will depend on vertical or horizantal, play around with the smallest number to get the desired thickness. ex. Size = 352,8 (change the 8 to a 1 to get the thinnest line possible)
Now make both a vertical and horizantal line, copy and paste each so you have 2 of each and just resize them to make a box/border around the textbox.
|
|
|
|
|
Hi,
I need print a lot of DOC, XLS, PDF, PPT files with the path in header or footer.
Thanks
|
|
|
|
|
Dim wrd As Word.Application
Dim doc As Word.document
Set wrd = New Word.Application
Set doc = wrd.Documents.Open("c:\Filename.doc")
wrd.Visible = True
'Header
wrd.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With wrd.Selection
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.TypeText "Header Text"
End With
'Footer
wrd.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
With wrd.Selection
.ParagraphFormat.Alignment = wdAlignParagraphRight
.TypeText "First Line of Footer text" & vbCrLf & "Second Line of Footer text" & vbCrLf & "Third Line of Footer text" & vbCrLf
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.TypeText "Fourth Line of Footer text"
End With
'doc.Close wdSaveChanges
Set doc = Nothing
'wrd.Quit
Set wrd = Nothing
|
|
|
|
|
Does anyone know how to get rid of this database logon prompt when using crystal
reports. I am running my installed application on a client computer but it asks me
for my DB logon information everytime i run the report. Is there anyway for the report
to connect just using my connection string in my App.config file rather than prompting for DM info everytime?????????????????
|
|
|
|
|
Hi, please somebody tell me or rather explain to a novice VB6 programmer how to create a report whereby I can query it during runtime? Any help is most welcome.
THANKS!
Shiro
|
|
|
|
|
Im not familiar with VB6, just .NET
Is there any sort of parameter field feature when creating your report?
If so you will probably use that with a prompt, but like i said i dont know
anything about VB6.
|
|
|
|
|
hi there can anyone give me a hand with this i am having problems triggering an event in a set 8 hour time period from 12:00 to 8:00 for example and then during the 8 hour time gap run a small proceduer ever 10 mins any help would be great
many thanks
|
|
|
|
|
You shouldn't be using Timers this long. You can use a Timer to fire off a procedure that checks the current time with scheduled process times. This way, if your app gets shutdown unexpectedly, you won't have to calculate Timer lengths to keep your prcoesses on schedule. Your Timer should be set for once a minute or maybe even once a second, if needed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I need to draw a dynamically generated 256x256 grayscale bitmap on screen.
Drawing it "pixel by pixel" is extremely slow. (several seconds)
Drawing it on an ofscreen bitmap and then blitting it on screen is slightly faster, but still unaceptable.
On the full framework I got around to accessing the bitmap data, and accessing the pixels directly, giving instant results.
Is there any way to achive this on the Compact Framework?
(or any other method that works...)
If the "AddressOf" worked for the bitmap, so I could get a IntPtr to it, I think I could then go in there and set the pixel data myself... But I was unable to find a way to do that.
The current code:
Dim ImgRAW(256, 256) As Byte
' GetImage(Imgraw) '... Fill up dynamic image
Dim offbmp As New Bitmap(256, 256)
For scan = 1 To 255
For x = 1 To 255
t = ImgRAW(scan, x)
offbmp.SetPixel(x, scan, Color.FromArgb(t, t, t))
Next
Next
oG.DrawImage(offbmp, 400, 100)
Hope someone can help,
Thanks.
|
|
|
|
|
Your question would be better handled in the Embedded/Mobile Forum[^]. Even though your writing your code in VB.NET, your question has far more to do with the technology supported by the Compact Framework, and very little to do with VB.NET itself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry for that, I was a bit hasty when posting...
It's just that I'm trying to achive that in the last few days and am getting desperate!
I'll repost there. Thanks for the tip.
|
|
|
|
|
I have been using following code to set pixel color.Although its is coloring the pixels of picture box. But it is not coloring drawn lines on paint event.I fetch the pixel and trying to convert its color in black but drawn any line in differnet color, not able to convert in black.
Code:
On m0usemove event:-
Dim bm As Bitmap = PictureBox1.Image
xmax = bm.Width - 1
ymax = bm.Height - 1
For y = 0 To 10
For x = 0 To 10
' Convert the pixels to grayscale.
With bm.GetPixel(e.X + 10, e.Y + 10)
clr = 0.1 * .R + 0.2 * .G + 0.2 * .B
End With
bm.SetPixel(e.X + 10, e.Y + 10, Color.FromArgb(255, clr, clr, clr))
Next x
Next y
On paint event i have been using below code:
For index As Integer = 0 To 3
Dim CurrentPen = New Pen(Color.FromArgb(myAlpha, myUserColor(index)), 15) 'Set up the pen
e.Graphics.DrawPath(CurrentPen, path(index)) 'draw the path!
Next index
If any body have idea its welcomed!!
|
|
|
|
|
Your mouse event painting should be handled completely inside your OnMouseMove event. The Paint event should be used to repait your forms controls in the event that another window is passed over yours and your window need to be repainted. It should not be used to handle mouse-move based drawing.
Your previous code that you posted was a jumbled mess. There's really no way of fixing to get it to do what you wanted without re-writting the entire thing.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hye Guys
I have build a distributed application and when I deploy my components on client it works fine for the first time. but next time when I reboot the machine it gives this error..Cannot Create ActiveX Component... then I have to uninstall and re-install the component every time and on re-installing there is no gurantee that will work or not as I do it many times to run this again.
Any comments and suggestions will be highly appreciated..
|
|
|
|
|
I'm going to develop an application whcih send sms to their clients on the bassis of changes in Stock Exchange Rates after regular intervals. I also want to know about free web serives for sending sms.
Din
|
|
|
|