|
hi all
I am working on vb.net window application where i am using adobe acrobat 7.0 browser to open pdf inside the browser. I want to disable the mouse scroll.I can remove the scroll bar but the mouse scroll button still works . so that user should be able to see only the page that is specified ( i don't want user to scroll to other pages in pdf). Can any one tell me how to disable the mouse scroll button on pdf browser
Thanks and Regards
Prakash Mishra
Prakash Mishra(Banglore,India)
|
|
|
|
|
Well, if you're using a web browser control in one of your forms to do this, I guess you could override your form's WndProc method and look for WM_SCROLL messages and just eat 'em. By that I mean not passing them on to the form's base WndProc method.
Another option might be to use a 3rd party library to render the PDF file, like PDFNet. This would also eliminate the dependancy on the web browser control and give you greater flexibility over what the user can see.
|
|
|
|
|
Hi All,
In my vb application, I am generating data from database and retriving it and placing it in MSFlexgrid which includes date column also.
And I am using the following code to convert the data from MSFlexgrid to Excel.
But in that, in Date column is in properly coming in MSFlexgrid. But when we convert it to Excel, some of the dates (like 12/03/2008, 11/03/2008,04/03,2008..I hope all the dates less than or equal to 12) will be converted like 03/12/2008, 03/04/2008, 03/11/2008...like this. But the other dates 25/03/2008...is populating in Excel correctly.
Please help me how to overcome this issue.
Dim xlObject As Excel.Application
Dim xlWB As Excel.Workbook
Set xlObject = New Excel.Application 'This Adds a new woorkbook, you could open the workbook from file also
Set xlWB = xlObject.Workbooks.Add
Clipboard.Clear 'Clear the Clipboard
With MSFlexGrid1 'Select Full Contents (You could also select partial content)
.Col = 0 'From first column
.Row = 0 'From first Row (header)
.ColSel = .Cols - 1 'Select all columns
.RowSel = .Rows - 1 'Select all rows
Clipboard.SetText .Clip 'Send to Clipboard
End With
With xlObject.ActiveWorkbook.ActiveSheet
.Range("b2").Select 'Select Cell A1 (will paste from here, to different cells)
.Paste 'Paste clipboard contents
End With ' This makes Excel visible
xlObject.Visible = True
Thanks in Advance,
Regards,
R. Sangeetha Priya
|
|
|
|
|
hi the way u r submitting the date and retrieving it may be there is the problem try this it may help
Dim signDate As String = Format(DateTimePicker2.Value, "MM/dd/yyyy")
Regards
Prakash Mishra(Banglore,India)
|
|
|
|
|
Hi,
Thanks.
The date is getting saved in "dd/mm/yyyy" format in database as well as its populating in msflexgrid in dd/mm/yyyy format.
But when try to convert it to excel, in this case only some of the dates formating is changed. Especially the dates from 1-12 is getting interchanged the month and date places.
Please help me how to format the cell so that it gets only in dd/mm/yyyy format, or suggest me some ideas to overcome this.
Regards,
|
|
|
|
|
I suspect its the cell format in Excel thats causing your problem. If the cell is not defined as a date format then it will display dates in what appears to be an odd format. Try applying a format to your cell and I suspect it will be all OK.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hey u can do one thing
in excel select the column in which u r showing the date, then click on for example A column so that the entire A column gets selected then right click and select format cell then click the tab number then select date then set the format as per ur wish it will set the property for that column permanently.
hope it helps
Prakash Mishra(Banglore,India)
|
|
|
|
|
Hi,
I am getting the error using the below code:-
In the While Loop after reading first records the error comes.
I am checking file extension in the if else loop within while loop.
if file extension is swf then I am calling DownloadSwfFle function.
DownloadSwfFle function where I am opening and closing connection to get some swf related information that is stored in another table.
else then other extension will be there then else part run.
my table contains 2 records in which 1st file contains swf extension.
If (conn.State = ConnectionState.Open) Then
conn.Close()
End If
conn.Open()
cmd = New SqlCommand("select * from table1 where = " & id, conn)
dr = cmd.ExecuteReader
While dr.Read
If filext(1) = "swf" Then
Call DownloadSwfFle(merchant_id)
Else
Dim filepath As String = dr("file_path")
If Not File.Exists(localpath & filename) Then
Dim oRead As System.IO.StreamReader
oRead = oFile.OpenText(Application.StartupPath & "\url.txt")
Dim url As String = oRead.ReadLine
Dim myStringWebResource As String = Nothing
Dim myWebClient As New WebClient
myStringWebResource = url & filepath
myWebClient.DownloadFile(myStringWebResource, localpath & filename)
End If
End If
End While
cmd = Nothing
dr = Nothing
conn.close()
|
|
|
|
|
sjs4u wrote: cmd = New SqlCommand("select * from table1 where = " & id, conn)
You'r SQL statement is malformed. The WHERE clause doesn't specify a valid expression for matching records. "WHERE = something " isn't valid. You need to change this so it looks like "WHERE someColumn = something ".
Beyond that, your code is an incomprehensible pile of spaghetti. I suggest cleaning it a bit so that the logic is laid out better and some of this is broken up into their own methods, like the SQL code.
|
|
|
|
|
How to delete data in a table which multiselected rows from a DataGridView?
|
|
|
|
|
how is the grid populated ? If from a datasource, probably remove from the source and rebind.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have been trying to add System.IO.Ports to VB 2003. I have tried using framework 2.0, but it won't let me and earlier versions don't have it in the System.dll. Anyone have any ideas?
Thank You,
Brian
|
|
|
|
|
Seeing as it was new in 2.0, it's not gonna be there in 1.1 or 1.0, right ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Right. Can I add 2.0 to a VB '03 project? That is what I was wondering and if you can, I have tried and it won't let me. Wondering if I was doing something wrong.
Brian
|
|
|
|
|
loganj1999 wrote: Can I add 2.0 to a VB '03 project?
No, you can't. .NET 2.0 classes cannot be used under .NET 1.x. You also cannot load two different versions of the .NET CLR into the same process. In order to use that class, you'd have to upgrade to VS.NET 2005 and .NET 2.0.
The other solution is to find a third party library for .NET 1.1 that implements Serial Communications for you.
|
|
|
|
|
I guess I will have to look for a 3rd party. I am adding functionality to an exsisting application.
Brian
|
|
|
|
|
Sorry, but here goes.
I have some controls on my form that show in the properties dropdown. But I can't find out where they are on my forms, so I can't seem to select them. If I try to delete their code from the designer -- big problems. How can I figure out how to select those controls if I can't find them on the form?
Thanks
|
|
|
|
|
Select them from the dropdown, then look at the location property to see where it is on the form. Try right clicking on other controls in that same location and choose 'send to back' if you have a need to select the control on the form, it's probably off the form, or it's covered by somethign else.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks.
Yes, I did that already... the problem really is that I'm not even sure what form the lost control is on. Is it possible to retrieve that information from somewhere? I was looking for a controls.add line in the designer but didn't see it.
|
|
|
|
|
Sorry, I don't mean that I can't find which form it's on, but rather where on the form it is (which tabpage, within which splitcontainer?)
Thanks
|
|
|
|
|
OK, that I'm not sure of.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
OK, thanks. I think I'll try to start deleting things until the lost controls disappear! Or if that doesn't work just rename them and keep them hanging around as ghosts. A strange situation that they can't be selected or deleted from the properties tab or somewhere.
|
|
|
|
|
hi
As i understood u have certain controls on page that u r not visible or u r not able to find them or its hidden below some other control.
In my opinion u can create a new form add the necessary controls on the new page and delete the old page.
Regards
Prakash Mishra(Banglore,India)
|
|
|
|
|
Hi,
if you know the name of the Control you want to manipulate, you can:
1.
use the combobox to get to its properties, then change its location (say to 50,50)
to make sure where it will be inside its parent;
unfortunately I don't see Parent as a property, hence:
2.
read the designer-generated code add look for a XXX.Controls.Add(...ControlName)
to find out that XXX is the parent.
If you don't know the name and don't see it, you're out of luck. I then hope you will use
better names next time.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks to everyone for the excellent suggestions. They really helped me.
I think that the code for the objects, which should have been deleted, still existed in the designer. However the controls were never being added to the form which is why I couldn't select them.
I was able in the end to get rid of them by editing the designer.
cs
|
|
|
|