|
|
Hi Vasudevan Deepak Kumar.
Thank for your answer.
thanks you so much.
|
|
|
|
|
Hello!
It seems something very simple and straight forward but i am stuck with it....
While creating a print preview there is a default message appears... saying "Page 1 of Document1". How can i get rid of that message box?
Thanks in advance.
colgateas900197
|
|
|
|
|
What makes you think you are going to get an answer by reposting the same question you asked 5 postings below?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
I am sorry, if i have violated some rule!
It seems stupid but i have postd this question almost 19 hours ago but no replies... I thought no one has given importance to my question...
Thanks for being there and keeping eye on my messages
colgateas900197
|
|
|
|
|
I would suspect that you did not get any replies because no one has an answer for you. It is likely that you will have to live with the pop-up box.
When you repost a question, you push someone elses question further down the list, and the further down the list a posting goes the less likely it is that someone with an answer will read it. This is why people get annoyed by duplicate postings.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
I guess the Truth worth 1 vote nowadays
Bump back for you..
|
|
|
|
|
SoInnocentIAm... wrote: It seems stupid but i have postd this question almost 19 hours ago but no replies...
Because either someone who has the answer didn't have enough time to see and reply to your post, or because you've asked a question that requires some research. Again - not enough time to reply.
This is a FREE site that is supported by VOLUNTEERS. We donate our time answering questions however much we can, whenever we get the chance. We do not get paid to do this. This means that it may take a couple of days to get an answer. BE PATIENT!
If you want an answer the same day, call up some support organization and pay them to solely work on your question.
|
|
|
|
|
Thanks Dave!
I am searching and trying to find a solution...
If i found one... I will let you know.
However, i will still be waiting for some help...
It may be a miscommunication Dave...! I have said that "It seems stupid..." for myself that after few hours i have reposted my question. I respect all members on this forum who give their precious time for helping others.
Thanks.
colgateas900197
modified on Tuesday, June 3, 2008 8:43 AM
|
|
|
|
|
|
I have two questsions.
The first being is it possible in VB to have a user input information during the file setup and have that information be used in the source code, then compiled, and then used after the setup is complete?
Say I want to have the user input their name, the user does and when the setup is complete and he/she opens the end result program their name appears as the title of the form.
Question number 2.
Is it possible to have a program, recreate itself with another name? So it's sort of like a name change?
Like say I have name1 and when I click on the .exe it will copy itself and make name2 or randomly generated letters or numbers.
Any help is appreciated.
|
|
|
|
|
You'll have to store the user input somewhere (registry, file, etc.) and then read it when the program runs.
To help you get started, you can write a line to a file with:
My.Computer.FileSystem.WriteAllText("file.txt", "userinput", False) And then read it with
Dim UserInput As String = My.Computer.FileSystem.ReadAllText("file.txt")
Me.Text = UserInput
The registry would probably be better suited for something like this. (Article on using the Registry[^].)
You can make a copy of the executing program just by doing File.Copy(Application.ExecutablePath, "c:\name2.exe") .
You aren't trying to make a virus, are you?
|
|
|
|
|
Hmm, virus no, I want to be able to send out like a set up file and the user inputs data and then the setup completes and the end .exe has the data the user input, hardcoded and can be used in the program. I'm not sure how I would get them to make a text file w/ the data.
|
|
|
|
|
How would I return a string array from a function? In other words, how would I modify:
Public Function ButtonClick(index As Integer) As String
So that it doesn't return just one string, but an array of them?
Thanks!
|
|
|
|
|
did you try ... as String() ?
|
|
|
|
|
You also could use StringCollection in the System.Collections.Specialized namespace (or Collection(Of String) for that matter). I seem to recall MS don't like things to return Arrays (this might just apply to Fields, I can't remember which one FxCop complains about...) I suppose it depends what you intend to do with the data later, but I often find Collections can be more useful and easier to work with.
|
|
|
|
|
Hi all.
I have written a simple application in vb.net (2.0) that reads data from an excel sheet (previously stored in focus databases) and stores it into a sql server database. I am using typed datasets and table adapters to store the data. I have an "Import" button whose event handler does the following in turn.
1. connect to the excel sheet through an ole db conn
2. read the contents in a while loop using the executeReader() method
3. store the values in variables where necessary conversions and validations are performed.
4. call an insert method in the associated dataset tableAdapter that stores these processed values in the sql db.
This is all working as it should. Now I need to check for existing records before I import the values - Ignore completely if the value is found.
According to msdn, I should be able to use my tableAdapters update method by passing a dataSet/Table/Row(s). So this is how I tried to tackle it.
Legend:
lbf = my DataSet
lbf_COKEnCOLE = the Database table associated with lbf DataSet
GetRecordByIdDateLab = runs the following SQL Query on the data
SELECT *
FROM lbf_COKEnCOLE
WHERE (ORIGINATOR_ID = @ORIGINATOR_ID) AND (SMPL_DTE = @SMPL_DTE) AND (LAB_NUM = @LAB_NUM)
(The actual sql refers to all the columns by names instead of using *)
Dim tableadapter As New lbfTableAdapters.lbf_COKEnCOLETableAdapter
Dim dataTable As lbf.lbf_COKEnCOLEDataTable = Nothing
'check for existing record by using GetRecordByIdDateLab method
dataTable = tableadapter.GetRecordByIdDateLab(ORIGINATOR_ID, SMPL_DTE, LAB_NUM)
If Not dataTable Is Nothing Then
If dataTable.Rows.Count > 0 Then
If Not dataTable(0).ORIGINATOR_ID = Nothing Then
'Row = dataTable(0)
dataTable(0).TURN = TURN
dataTable(0).SMPL_ANALYS_HOUR = SMPL_ANALYS_HOUR
dataTable(0).SMPL_ANALYS_MIN = SMPL_ANALYS_MIN
dataTable(0).MOISTURE = MOISTURE
dataTable(0).S = S
dataTable(0).VM = VM
dataTable(0).ASH = ASH
dataTable(0).HARDNESS = HARDNESS
dataTable(0).STABILITY = STABILITY
dataTable(0).QRT_TUMBLE = TUMBLE_30M
dataTable(0).APTSPC_GRAV = APTSPC_GRAV
dataTable(0).FREE_SWL_I = FREE_SWL_I
dataTable(0).PULV8TH = PULV8TH
dataTable(0).QRT_PULV = QRT_PULV
dataTable(0).SCR_4 = SCR_4
dataTable(0).SCR_3 = SCR_3
dataTable(0).SCR_2 = SCR_2
dataTable(0).SCR_1NHALF = SCR_1NHALF
dataTable(0).SCR_1 = SCR_1
dataTable(0).SCR_3QRT = SCR_3QRT
dataTable(0).SCR_HALF = SCR_HALF
dataTable(0).SCR_38THS = SCR_38THS
dataTable(0).SCR_QRT = SCR_QRT
dataTable(0).QRT_PULV = QRT_PULV
dataTable(0).SCR_8TH = SCR_8TH
dataTable(0).SCR_20M = SCR_20M
dataTable(0).SCR_30M = SCR_30M
dataTable(0).SCR_50M = SCR_50M
dataTable(0).SCR_100M = SCR_100M
dataTable(0).SCR_PAN = SCR_PAN
dataTable(0).SCR_QRT_PLUS = SCR_QRT_PLUS
dataTable(0).SAMPL_LOC = SAMPL_LOC
tableadapter.Update(dataTable) '<<THIS IS WHERE IT CRASHES WITH "A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.dll
End If
'The following tableAdapter works perfectly whenever the condition is true (for new entries that is)
ElseIf dataTable.Rows.Count = 0 Then
tableadapter.InsertQuery(counter, ORIGINATOR_ID, SMPL_DTE, LAB_NUM, TURN, SMPL_ANALYS_HOUR, SMPL_ANALYS_MIN, _
MOIS_GRAV, MOISTURE, S, VM, ASH, HARDNESS, STABILITY, QRT_TUMBLE, TUMBLE_30M, APTSPC_GRAV, _
FREE_SWL_I, PULV8TH, QRT_PULV, SCR_4, SCR_3, SCR_2, SCR_1NHALF, SCR_1, SCR_3QRT, SCR_HALF, _
SCR_38THS, SCR_QRT, SCR_8TH, SCR_20M, SCR_30M, SCR_50M, SCR_100M, SCR_PAN, SCR_QRT_PLUS, SAMPL_LOC)
End If
End If
****************************************
More details:
I have DataTable under "Watch" and the value for it shows up as "dataTable has not been declared". This ofcourse is misleading because it is, plus intellisense picks it up where I'm updating the column values by referencing them with dataTable(0).columnName
I have been wondering if
dataTable = tableadapter.GetRecordByIdDateLab(ORIGINATOR_ID, SMPL_DTE, LAB_NUM)
does what its supposed to do, ie. return a dataTable with the matching record. I tried to recieve the data in a row but it only allowed it to be saved in a datatable instantiated in this manner. Furthermore, when I read the values read into the datatable, each column value shows up only as lbf_COKEnCOLE.column (something to this effect) in curly braces. Almost everything else thats returned, like index values and what not that I suppose is used to keep the schema of the table has errors in it.
Any suggestions and help would be greatly appreciated!! I am trying to avoid suddenly using command objects when I'm doing everything else through a data Access layer. lastly, I have read and reread this msdn page
http://msdn.microsoft.com/en-us/library/ms233819(VS.80).aspx
and am trying to do everything as shown here, obviously to no avail
All .net people out there, if you would help this awkward programmer, it would be greatly appreciated! Thanks
~Ghazanfar
|
|
|
|
|
You probably want to shorten some of the lines in your code, some of your sentances are being lost at the edge of the screen, and I can't really work out what your question is properly.
|
|
|
|
|
Hi I am developing one application in Visual Basic 6.0, in that application, I am opening pdf file and word file through my software using Web Browser control. I want to restrict the document in such a way that no body will copy the information.
Therefore I want to disable the Ctrl+C , Ctrl+V, Ctrl+X from Keyboard.
Please help me.
Ranjan
ranjan175@hotmail.com
biswaranjan_nanda@rediffmail.com
|
|
|
|
|
How is this different from your last post[^]? If someone wants to copy something bad enough they'll just take a screen capture.
|
|
|
|
|
I am sure you can disable copy for PDF, but not sure how. Search on google and you will find something on it.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Hello!
I have a little problem....
When i get a print preview of any document how can i hide a small message box saying "Page 1 of 1 Document" befeore displaying print preview?
I dont want it....!
Could any body help me?
Thanks
colgateas900197
|
|
|
|
|
|
I have opened an image as a bitmap using GDI+. Before I save it I want to know if the image has transparency in it. That is; is there any pixels in the bitmap that has the transparent color. I have made a solution that looks like this:
Dim objImage As Drawing.Bitmap = Drawing.Image.FromFile("png_with_transparent_bg.png")
Dim booTransparentColorFound As Boolean = False
If Bitmap.IsAlphaPixelFormat(objImage.PixelFormat) Then
For y As Integer = 0 To objImage.Height - 1
If booTransparentColorFound Then Exit For
For x As Integer = 0 To objImage.Width - 1
Dim objColor As Drawing.Color = objImage.GetPixel(x, y)
If objColor.A = Color.Transparent.A And _
objColor.R = Color.Transparent.R And _
objColor.G = Color.Transparent.G And _
objColor.B = Color.Transparent.B _
Then
booTransparentColorFound = True
Exit For
End If
Next
Next
End If
The problem is that if the image is very big, and there is no transparent pixel in it (or a transparent pixel is located in the lower right corner), the routine is very slow. Is there some quicker way to determine if there is transparency in the image?
Thanks in advance.
...Allan, Denmark
|
|
|
|
|
You only need to check the alpha channel (objColor.A) to find out if the color is transparent.
You can use the LockBits and UnlockBits methods to get access to the pixel data, to circumvent the GetPixel method. In VB you need to use marshalling to copy the data into an array, though. If you would have used C#, you could use pointers to access the data directly.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|