|
In a skin changing program , I need to get the handle of dialog.
However , there is only hInstance and hWnd handle in a form.
What should I do?
|
|
|
|
|
The handle of the dialog? That's it's window handle, which is it hWnd property in Windows Forms.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks I will try that Monday morning. I will let you know the results. Thanks again.
|
|
|
|
|
The application in question has a comboBox which is used to select a person's name. This then allows getting the person's username and password. Next, a button is clicked that captures a frame from a webcam, creates a badcode based on the username and password and then prints the image, barcode and name to a Dymo labelwriter.
When the button is configured to show the PrintPreviewDialog, the label displayed is exactly correct:
badgePreview.jpg
However, when the button is configured to actually print, the label is only partially printed:
badgeActual.jpg
This really has me stumped - please help. This zip file, sselBadge.zip has the entire VB file.
----
Gerry Roston
Pair of Docs Consulting
www.pairofdocs.net
|
|
|
|
|
I am currenly undertaking a pet project of making a telnet mud client and am hung up on some of the basic functionality.
I cant seem to find a way to keep the main display textbox (am using a rich textbox control) to stay scrolled to the last entry. the scrolltocaret() function works only when the rtb is focused and even when it is tends to be a bit flaky . plus i cant keep focusing the main display as the focus should be in the command line textbox almost all the time.
so i am in need of a command that will always keep the main textbox scrolled, preferably somthing i can toggle on and off so you can view past text without having it constatnly trying to scroll to the end.
in addition to scrolling im not sure how i should implement coloring. in the end the client must be able to pick words and phrases based on triggers and color them appropriatly. i had limited success with changing the color property as it was writing the recived string but it was clunky and slow.
and lastly i have had no success in creating an efficient scroll back buffer for the textbox. textboxes contain a maxLength property (default is 2,147,483,647 characters) but it seems that if i change it to lower and it fills up the program crashes. what i would like is to set a more practicle buffer size.
any suggestions and help on how to implement these things would be appreciated.
FYI im writing in VB .NET and using Visual studio 2003.
|
|
|
|
|
Sounds like you'd do well to create your own textbox control.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Dear Sirs,
I am trying to download a csv file from the internet using
the MSHTML model and can successfully obtain the data to a
HTMLDocument variable using the following.
Dim objMSHTML As New MSHTML.HTMLDocument
Dim objDocument As MSHTML.HTMLDocument
Set objDocument = objMSHTML.createDocumentFromUrl
(txtURL.Text, vbNullString)
where txtURL.Text
= "http://www.a_web_site.com/download/data.csv"
What I cannot do is extract the csv data from the
variable, as it does not appear to be associated with any
node / element etc.
I know the objDocument does contain the data as I can
check the size of the variable to which it returns a
largeish value
I am really quite lost with all this - I do not really
understand how all this works and have been trying to find
an online resource that explains it in lay terms, however
everything that I have located to date goes way over my
head!
Hoping someone can assist
Regards
Jack
|
|
|
|
|
Option Strict Off
Imports mshtml
Public Class Form1
Inherits System.Windows.Forms.Form
Public Function toHex(ByVal number As Integer) As String
Dim hexbyte As String
hexbyte = Hex(number).ToString()
If hexbyte.Length = 1 Then
hexbyte = "0" & hexbyte
End If
Return (hexbyte)
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim url As Object = "about:blank"
WebBrowser.Navigate2(url)
Application.DoEvents()
(CType(WebBrowser.Document, HTMLDocument)).designMode="on"
End Sub
Private Sub btnviewHTML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
tbHTML.Text = _
(CType(WebBrowser.Document, HTMLDocument)).vody.innerHTML
End Sub
Private Sub btnPreview_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
(CType(WebBrowser.Document, HTMLDocument)).vody.innerHTML=tbHTML.text
End Sub
|
|
|
|
|
What sort of help do you want ? Comments on your coding style ? You expected that you wrote 3D space invaders, but you can't get the pixel shading to work ?
Maybe if you said both what you expected to see, and what is going wrong, someone will help you.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
At the beginning of each one of the parentheses. I get a syntax error. Why is this?
|
|
|
|
|
Because there's no parenthesis around the class as a whole ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I'm sorry, you explain that what I mean is I am textbook programming. I am writing this code out of a book. I am new to programming. I am trying to learn, could you possibly showed me what it is supposed to look like?
|
|
|
|
|
OK. First of all 'option strict off' really sucks.
Secondly, simplifying the example a little:
Option Strict Off
Imports mshtml
Public Class Form1
Inherits System.Windows.Forms.Form
(
Public Function toHex(ByVal number As Integer) As String
Dim hexbyte As String
hexbyte = Hex(number).ToString()
If hexbyte.Length = 1 Then
hexbyte = "0" & hexbyte
End If
Return (hexbyte)
End Function
)
See how everything that's 'inside' the class is in brackets ? Open a bracket where I did, close it at the end of your file.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian thank you for your help so far but Christian, I don't have an error in that part of the code the form load event, where the code is as follows (cCType. There at that bracket is where I have the error. The next line of code button click event HTML view is OK. I get the next error in the line of code as follows
ByVal e As System.EventArgs)
(CType(WebBrowser.Document, HTMLDocument)).vody.innerHTML=tbHTML.text
at the bracket (ctype is where the error occurs. And so forth. Why do I have an error, they and not private sub buttonview
|
|
|
|
|
What is 'vody' ? What's the error ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I get a blue squiggly right before the ( It says syntax error
|
|
|
|
|
To repeat, what is 'vody' ? Are you sure it shouldn't be 'body' ?
And for the record, if you can't work this out, you need to buy a simpler book. You shouldn't start typing this stuff in until you have some idea what it means.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thank you you are right, that was a typo on my behalf. It is supposed to be body but that did not correct the errors
|
|
|
|
|
It would appear that VB can't swallow extra brackets.
change
(CType(WebBrowser.Document, HTMLDocument)).body.innerHTML
to
CType(WebBrowser.Document, HTMLDocument).body.innerHTML
Read this article: http://www.codeproject.com/dotnet/CheatSheetCastingNET.asp[^]
It looks to me like you should use DirectCast, not CType.
In any case, you're obviously out of your depth. Put this book on the shelf until you are able to understand what the code does, through reading a more basic book. Typing stuff you don't understand out of books is neither programming, or educational.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
ty for your help christian I suppose you're right the name of the book is called network programming in.net is step-by-step and explains what is what as you go, but as you can see. It's not working that well will anyway. Thank you for your help Delo
|
|
|
|
|
Christian I understand what you are trying to tell me what I find it easier to go through a book and write the sample programs, and then see what they do. And then examining the code it seems to be easier for me to learn this way or example. A module I learned that if I needed to write code that was repetitive. I could simply do it in a module, and if I gave it the name sub, whatever than in any new program that I wrote that I could use this module than simply behind the button type the code whenever different people learn different ways Christian. Is there a book out there that you are familiar with that is not Microsoft Visual Basic.net step-by-step designing enterprise application with Microsoft Visual Basic.net or programming Microsoft Visual Basic.net. And of course we know the other one network programming in.net. Any information you may have on this would be greatly appreciated. Thank you again Delo
|
|
|
|
|
Sorry, I don't like Visual Basic. I own no books on it. I help here because I can, because VB and C# use the same libraries. I'm sure there is a VB.NET for dummies or VB.NET in 24 hours. That's not an insult, those books are just written to take things as slowly as possible for an absolute beginner. My first ever book was Visual C++ in 24 hours, and it was a great way to start.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi: I really don't know which line it is on. All I was told was that something was not defined corectly. I looked over the rest of the code and initialized the variables to zero and 0.00 where needed. Other than that I really don't know where to look. I do know that this is the subroutine where the error is happening.
I was trying to put a line number or error number on the error message at the bottom but I couldn't find the syntax for the error code in order to capture it.
Thanks again
PS. This is supposed to be a simple add, delete record program, no special effects thing.
|
|
|
|
|
Try putting a try/catch around the code that's blowing up, but create variables outside the block. Then put a break point in the catch, and check what the values of the variables are. That should get you on the track to figure out what's going on. Remember that all numeric variables have a max and min possible value, which are defined by constants you can access of the type, as in int.maxvalue.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i hv a task abt booking appointment and i get stuck on it...can anyone help me to code it out in VB.NET???....
Below is the booking process flow:
1. Booking appointment: MemberApptForm.aspx
-There is a drop-down list for time (probably in hours) and a Calendar for date picking.
-Validation:
a)If date is on holiday, reject.
b)If date is ok, time is free from appointment (no record in database), allow appointment to be saved
(set booking status to 0).
c)If date is ok, time is booked by other users and current date is greater than 3 days, place pending appointment (set booking status to 0,1,2 and so forth).
i.e.-if the user cancel the appointment is with booking status 1, email will be sent to the user (same time & date) with booking status 2.
2. Cancel appointment
a) Remove the record of the user from the appointment table.
b) result:
- Return appointment Canceled.
- Send email to the user with Appointment status of the user with the precedent record with same date & time.
c) In other words, the user that will hold the appointment right is the one with the lowest number of booking status.
that's all for the process, so pls help me!!! i'm in urgent now...thanx..
|
|
|
|