|
Hi Murray,
I'm beginning to like this printing capability. I'm not very good at it yet but I do see the potential for good reports. It takes a lot of code and but most of it is understandable. Crystal Reports is an attempt to greatly simplify things. And although this sounds crazy they've made it so damn simple I can't understand it. I just have so much trouble with CR. With this language you can use simple VB constructs like 'if then else' and in CR they do have 'if then else' but it's really different. I would rather spend 3 days working on one report than even 10 minutes with CR. I know that after spending 3 days with VB I would have something; 3 days with CR and all I would end up with is a huge headache.
Someday I'm afraid you're gonna have to upgrade from VB 6. I hope not though. No one would want to do all the conversion work on your codebase. Here's a business opportunity. Write a program to do just the report conversions. I say 'just' as if this would be trivial; it certainly would not be. But, if you, or one of your co-workers could do it it would be worth something. Maybe it's already been done; I don't know.
That's fabulous that your products do work for the government. That is HUGE!! If a company could have only one customer that is the one they should want; the US Govt. This is very impressive.
I'm a retired Fed. I was a software developer there for 30 years. I worked on administrative systems to include accounting systems. I had co-workers that worked on payroll although I never did. I know some of the complexities though and I know there are many.
Keep the faith Murray. I'm gonna get back to work on these reports. In this methodology one has to line breaks, page breaks, etc. I like detail work though so I'm a happy camper.
Thanks Murray and happy Wed. to you. jack
|
|
|
|
|
Hi Jack,
You're so right about the detail work that it is capable of. I looked @ it some more and it is really nothing more than an extremely complicated version of what I use in VB 6. The abilities for placements, fonts, kerning, leading and so on are excellent. They do require attention to detail but, what non-trivial programming doesn't? Attention to detail is what separates the hacks from the professionals.
What language did you code in?
Murray
|
|
|
|
|
Murray, I did some COBOL back in the day but the last 16 years of my career were spent with a product I'll bet you've never heard of. Not many have. It's Model 204. It has been around for 40 years and it is so powerful. It's a DBMS with it's own proprietary language. It's for mainframe IBM computers (if they still exist) with very large databases. It really hums. Here's a link. Spend a minute or so checking it out.
http://sirius-software.com/m204.html[^]
|
|
|
|
|
You're right - I've never heard of it. I used COBOL and FORTRAN on IBM mainframes. Then again I've never worked on government-scale databases.
No wonder my friends who code for the IRS moan when Congress enacts a payroll change and gives us 30 days to implement it.
I must assume that mainframes still exist although I saw a Cray supercomputer in a box about the size of a PC only twice as wide. Microsoft was offering it as a prize.
Murray
|
|
|
|
|
It's been long years since I've even heard of a Cray computer. I wonder if they still exist. At one time they were considered top of the line. And yes, you could probably put in a box of Cracker Jacks now. It would fit. Happy Thur Murray. jack
|
|
|
|
|
my code already can send sms but when i want to send more than 160 character it will not work..some one help me plss..
below is my code:
Sub SendSMS()
If Modem.IsOpen = False Then
MsgBox("Port not Open!!")
Exit Sub
End If
If Me.TxtTo.Text = "" Then
MsgBox("No recepient number!!")
Exit Sub
End If
If Me.TxtSMS.Text = "" Then
MsgBox("Blank text message are not allowed!!")
Exit Sub
End If
sendbutton.Enabled = False
Sending = True
SendAttempt = 0
Do
ATSend("AT+CMGF=1")
Result = ATRead(1000)
Loop While Result.Contains("COMMAND NOT SUPPORT")
Do
ATSend("AT+CSMP=17,167,0,0")
Result = ATRead(1000)
Loop While Result.Contains("COMMAND NOT SUPPORT")
Do
Do
ATSend("AT+CMGS=""" & TxtTo.Text & """")
Result = ATRead(1000)
Loop While Result.Contains("COMMAND NOT SUPPORT")
ATSend(TxtSMS.Text & Char.ConvertFromUtf32(26) & vbCr)
Result = ATRead(10000)
SendAttempt += 1
Loop While Result.Contains("COMMAND NOT SUPPORT") Or (Result.Contains("ERROR") And SendAttempt < 5)
If Result.EndsWith(vbCrLf & "OK" & vbCrLf) Then
TxtSMS.Text = ""
TxtTo.Text = ""
Else
End If
sendbutton.Enabled = True
Sending = False
End Sub
|
|
|
|
|
SMS has a 160 character limit. You cannot change that as it's built into the SMS standard specification.
Read up on MMS (Multiple Message Service) insead.
|
|
|
|
|
how i can use MMS to send SMS?? 
|
|
|
|
|
I've already told you what to do. Just do it.
|
|
|
|
|
i already google it but i dont understand..im newbie in visual basic..sorry for that..
|
|
|
|
|
do you have sending and recieving sms sysytem?? in vb.net
|
|
|
|
|
I have a Picture Box where I use GDI+ to draw lines, circles, etc on. What I have noticed recently is that my other GUI components such as buttons, option boxes, labels, etc. on the same form are not displaying correctly. What I mean by that is they are all black until I click on them or resize the form then it will display properly. However, if I minimize the form then restore the form the GUI components will turn black again.
I did some googling and found out that there seems to be problem with a threading issue. I pin pointed it to my picture box paint event handler. If I comment out the entire event everything displays properly minus what I need to paint in my picture box.
My thinking was maybe I should do some multi-threading so I can get the best of both worlds objects painted in the picture box and my GUI components displaying properly on initial form load.
The first piece of code is my original code with the black showing components. I have tried to use threading in hopes that this will remedy my situation. Because of my limited (near 0) knowledge of threading this may not be the best piece of code. What I get in the threading code is the error picture for my picture box (large red "x" on white background).
Private Sub Picture1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Picture1.Paint
myGraphicObject = e.Graphics
myGraphicObject.Clear(Picture1.BackColor)
Draw_GDI_Related_Things_Function()
End Sub
Private Sub Picture1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Picture1.Paint
System.Threading.Monitor.Enter(myGraphicObject)
myGraphicObject= e.Graphics
myGraphicObject.Clear(Picture1.BackColor)
m_threadDraw = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf Draw_GDI_Related_Things_Function))
m_threadDraw.Start()
System.Threading.Monitor.Exit(myGraphicObject)
End Sub
Keep in mind that the above code is a before and after.
Can someone help me to understand what I am doing wrong?
Thanks.
|
|
|
|
|
Threading is not your solution to black controls.
You cannot touch any property or method of a control from anything other than the UI thread (the thread that created the control instance.) Doing so will only cause bugs that are very difficult to find.
The reason you get the red X is because your drawing code isn't finished yet but the Paint handler already returned control back to the event originator, which is trying to copy the control image to the screen, which you haven't finished drawing yet.
Remove the threading code. You don't need it at all.
|
|
|
|
|
Yeah Dave, I figured that was the cause and I went ahead and removed it. That was my initial suspicion as well, but I just wanted someone more knowledgeable than myself to confirm it.
I know this is a tiny bit unrelated, but what my new suspicion is that my data grid view might be the cause of this painting annoyance. I emphasis might because once again I could use your advice.
In my data grid view I have added combo boxes to one column and now I receive this error every time per number of rows I have when I resize the form.
See code below.
Private Sub frmEdit_System_Revised_Resize(sender As Object, e As System.EventArgs) Handles Me.Resize
Me.DataGridViewObj.Width = Me.Width / 2
Me.DataGridViewObj.Top = Me.ComboBoxObj.Top + Me.ComboBoxObj.Height
Me.DataGridViewObj.Height = (Me.MyPictureBox.Top) - (Me.ComboBoxObj.Top + Me.ComboBoxObj.Height)
End Sub
Maybe it's the way I insert data into the combo box inside my datagridview, but I receive this error continiously "datagridviewcomboboxcell value is not valid". I tried Googling this, but the typical reponses are to just suppress this error.
Maybe you can see what I am doing wrong. I would appreciate another set of eyes looking at this and pointing out what the problem is. Or maybe you can refer to me some literature that I can read on how to properly set data to a combobox column.
Inside my insert data sub routine...
Dim objRowData(NumOfColToFill) As Object
Dim newButton As New DataGridViewButtonCell()
Dim newComboBox As New DataGridViewComboBoxCell()
Dim newRowToAdd As New DataGridViewRow()
newRowToAdd.SetValues(objRowData)
Me.DataGridViewObj.Rows.Add(newRowToAdd)
newComboBox.Items.Add("Data")
newComboBox.Items.Add("Data1")
newComboBox.Items.Add("Data2")
newComboBox.Items.Add("Data3")
Me.DataGridViewObj.Rows.Item(m_intRowCounter).Cells.Item(5) = newComboBox
Me.DataGridViewObj.Rows.Item(m_intRowCounter).Cells.Item(5).Value = "Data"
Me.DataGridViewObj.Rows.Item(m_intRowCounter).Cells.Item(0) = newButton
Me.DataGridViewObj.Rows.Item(m_intRowCounter).Cells.Item(0).Value = "Data"
Thanks! 
|
|
|
|
|
I have no idea what your form looks like, but you could just use a TableLayoutPanel, properly configured of course, and put your DGV and Combo in adjacent rows. If setup correctly, you can eliminate the Resize code entirely.
The only time I've seen the "DataGridViewComboBox cell value is not valid" is when the value in the combo is not valid for the bound field. You could ignore it, but keep in mind that the error you're seeing is an exception and exceptions are VERY expensive to throw. Your code performance will suffer because of it.
|
|
|
|
|
Thanks for that advice. I will look into a Table Layout Panel and see if that will work out. 
|
|
|
|
|
Also, why are you adding a combobox to the DGV when there's a combobox column available??
It seems you're using the DGV as a kind of storage for your data instead of binding the DGV to a DataTable object and storing the data in there.
|
|
|
|
|
Good question.
Well, I have set the column in question as a combo box using the DGV edit column property page. If you will notice in my code I use a variable of the name of newComboBox which is a data type of "DataGridViewComboBoxCell". What my intention was to populate each row with the same data, but each row will have a different selection that can be saved. With that being said if the user saved that layout when the file gets opened I will populate the DGV with the same data, but the currently selected item would be different (if the user decided to select different items). I hope that makes sense.
My thinking was in order to populate each row with pre-defined data the best option was to use the variable newComboBox as mentioned above and reference that to the DGV. It functions as I expected, but the added benefit (sarcasm) I get is the thrown exceptions as I mentioned in my previous response.
You're correct that I am using the DGV differently then I guess what's intended in doing. (Maybe this is root of my problem?). I don't have a DataTable for which it can refer to.
|
|
|
|
|
Dave is right, threading won't help you. Remove it, and the Monitors. And put all painting code in the Paint handler. Here[^] is an article that gives the fundamentals; the examples use C#, the concepts are identical in VB.NET though.
|
|
|
|
|
I had a problem with something about my picturebox.paint_event constantly firing. Still to this day I am clueless as to why. I was about to post a new question in the vb discussion when I came across this discussion I started a while back. I wanted to let you know that link that you posted solved my problem.
My program would draw primitive shapes (circles, lines, letters, etc) onto a picturebox using gdi+, but like I said the picturebox.paint_event would always trigger. This would peg one of my cpus at 100%, rather annoying. After making the changes that website you posted suggested the results are like night and day. Instead of the picturebox I used a panel and the paint_event only triggers when it should be triggered.
I just wanted to circle back and say thanks! Even though quite some time has passed 
|
|
|
|
|
Forgive me I am a retired doctor and am just learning programming. I am playing with a small routine that will display number, and signs in rolling boxes to create a kind of slot machine effect to teach my granddaughter math.
I have listed the code below I am having a problem with. It will display the first set of pictures when I click on the button but will not display the pictures in the image list as it randomly selects them.
When I click the next three are moved and displayed but using a loop or a go to statement never works.
I do set the pictures to a default value prior to this routine.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Reel As Integer
Reelspin:
Dim intpic As Integer
Dim rand As New Random
intpic =rand.Next(0,ImageList3.Images.Count)
Me.PictureBox3.Image = PictureBox2.Image Me.PictureBox2.Image = PictureBox1.Image Me.PictureBox1.Image = ImageList3.Images(intpic)
Reel = (Reel + 1)
If Reel < 10000 Then goto respin
End Sub
I would be very great-full for any help I want to display the pictures as they change in real time.
|
|
|
|
|
First, using goto is akin to farting loudly in church. You just don't do it.
It doesn't work because your code is hogging the UI thread. This means that since your code isn't giving up control the UI thread can't process the PAINT messages that are coming into your app from Windows (updating the image you see on screen). The end result it that you only see the last image you set when your loop is done.
How do you get around this?? Forget the loop and use a Timer. Set the Timer to fire an event every 250 milliseconds or so. Start (enable) the Timer in your button Click event.
When your code to change which frame you see will be in the Timer.Tick event. Something like this:
Private RNG As New Random
.
.
.
Private Sub MyTimer_Tick(...) Handles MyTimer.Tick
Dim index As Integer = RNG.Next(0, ImageList3.Images.Count)
PictureBox3.Image = PictureBox2.Image
PictureBox2.Image = PictureBox1.Image
PictureBox1.Image = ImageList3.Images(index)
End Sub
You don't need to put Me. in front of everything.
|
|
|
|
|
First THANK YOU for responding so quickly...
Second I feel a dumb as a rock. Being a retired
doctor I thought programming would come a lot
easier to me.
I understand part of what your saying...
That being I have to give the the system time to
update the screen to allow the images to be painted
and seen before the next image appears.
Also I understand how to add the timer and set the value however, I am a little perplexed as to how to call the timer. Do I need to loop back each time until all the images have been displayed? And if so how and where do I call the timer to allow the delay? That is a delay after each image or just after each set?
Thanks again
|
|
|
|
|
A timer periodically fires an event, that is its job. And it is your code that deals with such event, that is what the "Handles myTimer.Tick " says in Dave's code snippet. So you don't provide the looping, the timer does that; you just tell it what to do each time.
|
|
|
|
|
OK now I am more lost than ever...
I understand that I need to slow the process down
and let the images be painted to the screen so each can be seen before it continues to the next image.
I also understand that the timer will do that...
Where I am getting lost is how you call the timer into action. I created it and set the value as suggested to 250. But do I place the code line prior to displaying any image images?
Further, I need to repeat this paint 1,2,3
over and over until the a random timer stops the images from being chosen and displayed.
At this point every time I press the SPIN KEY, or button as it were the images are selected, displayed and with every click they move down one image. Placing a loop, jump or any other kind of repeating function kills the display of any image until the last one, then that is displayed, hence the need for a delay so they can be painted.
If I understand right the timer only need to be activated once and it will fire on its own after that correct? Or do I need to reset the value after each use?
Thanks...
|
|
|
|