|
Johan Hakkesteegt wrote: Did you try to run your app in debug mode, with the break point set at the first line in the load event of the form?
Does the app ever even get to the breakpoint?
Yes, thank you for you advice. Now I found the problem that cause my system run incorrectly. Thank you very much for your help
|
|
|
|
|
I am having one query. I am having one parent folder which contains executable files and reports folder. i am having 6 databases by which each and every client will access the respective databases. Each client will access the same executables .The problem i am facing that if a client access the a report its report source is stored in the report 4.3. After sometime if another client access the same report it is showing the details of earlier accessed database. i want to change the report source.Please help me.
Sivaraman.
|
|
|
|
|
Dear friends,
When I make a tiff documents and print it with vb.net system.diagnosis.process and setting the verb as print, the spool size it huge.
I guess its the problem with the quality parameter. But how to overcome this?
Thanks,
|
|
|
|
|
Define "huge". Printing graphic images usually takes a ton of code in the printers language. Changing the quality of the printed image is not going change the size of the print job much.
|
|
|
|
|
Dear the total spool for 5 sum up to 5 mb becomes 150 mb when printing
with the other way..? how to decrease the colordepth to 1L?
|
|
|
|
|
Guy, you are leaving out so much information, it's impossible to tell you what's going on. How big is the image you're printing?? What format is it (BMP, GIF, TIFF, JPG, ...)?? What are it's dimensions and color depth?? What code are you using to print this image??
Changing the color depth has no effect unless you are saving the image to disk. Just adding the color depth parameter to an in-memory image has no effect on the image.
|
|
|
|
|
Sorry for those confusing and half looking posts.
Well I am usiing 1 bit depth images of size 11"*8.5" and of size around 10-50 kb and 200*200 dpi, ccit 4 compressioin.
Then i put one watermark on the first image and save to disk. (using canvas and the code abotve)
then all following images are taken in memory, put canvas and then joined to the first one to produce a multipage tiff.
The final tiff comes with 24L colordepth and size around 5mb (if has 5 images in it) and 96*96 dpi, lzw compression. And while spooling the size at the printer shows 152 mb.
|
|
|
|
|
And the code doing the printing?? What language is the printer driver using?? PCL, PostScript, ...???
|
|
|
|
|
I have been using only system.diagnosis.processinfo to print using verb = "print" and filename as argument. And tried this with two diffent printers and even with cutepdf and foxit pdf writer, but the same result.
|
|
|
|
|
Since you are not in control of the printing at all, there's nothing you can do to reduce the size of the job. From the sounds of it, the print driver is generating a bunch of printer language code for EACH PIXEL in the image. There's nothing you can do about it.
|
|
|
|
|
Dear Dave,
Would you please suggest me anyway out?
Or how to code for other printing system, but it should print file specified from network pc..
thanks,
|
|
|
|
|
Don't make me repeat myself. "There's nothing you can do about it!"
Sure, it may be a 96 dpi image on disk, but when it gets printed, it gets mapped to a 300, 600, or 1200, maybe even higher dpi image.
|
|
|
|
|
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y
For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);
var w = elem.offsetWidth;
var h = elem.offsetHeight;
var l = 0;
var t = 0;
while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}
return {"left":l, "top":t, "width": w, "height":h};
}
Trying by vb6 in webbrowser
Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document
For x = 0 To doc.getElementsByTagName("a").length - 1
Set elem = doc.getElementsByTagName("a")(x)
I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id
To while loop, but I can't figure it out how
While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend
Next x
|
|
|
|
|
I created a button control (does not inherit button) and it is not rectangular. I have corners that can be curved. To draw the button, i create a path and fill it. I want to know if the user is clicking on the button, so i was wondering if there is a way to check if the path i created contains the pixel where the mouse is when the mouse clicks. I thought about checking for the color, but the button has a gradient and it has a border color as well as a different border color when the user hovers over the button, so i don't think this solution will work.
Would Anyone have an idea for me?
|
|
|
|
|
Create a second image the size of the button's rectangle with a background set to white. Draw the exact same button image into this second image, but draw everything in black. If you want to do a hit-test, check the color of the pixel in the second image, not on the visible button image. If the pixel is black, you've hit the button...
|
|
|
|
|
Did you look at GraphicsPath.IsVisible() ?
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
What I am trying to do is imitate what I did for a web datagrid. The "Edit"/"Add" row had drop downs that would be populated so that the user could change a selection. What I would like is to somehow reproduce this in a Windows App so that I only have DataGridViewTextBoxColumns when the user is viewing the grid but once the user chooses to edit a row or add a row THEN I can replace the TextBoxColumns with ComboBoxColumns and fill them appropriately.
Is this possible without writing a custom DataGridView control? My drop downs are dependent upon the last chosen combobox selection.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Hi,
this is my code:
Try
Dim DbTest As SqlClient.SqlConnection
DbTest = New System.Data.SqlClient.SqlConnection("Data Source=(local)\SQL;Initial Catalog=testiranje123;Trusted_Connection=yes;Integrated Security=True;Asynchronous Processing=true")
DbTest.Open()
DbTest.Close()
Catch ex As SqlException
MsgBox("idemo dalje")
Catch ex As DataException
MsgBox("idemo dalje")
Catch ex As Exception
MsgBox("idemo dalje")
End Try
the connection string is wrong, i did this on purpose. So i can catch the exception and handle it and build a connection string change mechanism...
the exception is:
SqlException:
Cannot open database "testiranje123" requested by the login. The login failed.
Login failed for user 'test\test'.
There is no way I could catch the exception. I tried all kinds of catch exception handlers but no luck the exception just keeps showing up.
Please, if anybody knows the answer, it is urgent.
Thank you very much!
|
|
|
|
|
You mean that when you run that code the msgbox never appears? instead it stops at DbTest.Open with an exception?
|
|
|
|
|
Yes, that is what I mean, Thank you.
I can not catch the exception it keeps showing up. But i want to catch it and handle it. The msgbox is just a test to see if it can catch it. But the msgbox never shows up.
Please, if you know the answer share it with me!
Thank you.
|
|
|
|
|
Hi,
I have had to make a custom web browser. Now I need to load existing IE toolbars such as Google Toolbar. Could anyone guide me as to how to do it?
Thanks,
Ahmad
|
|
|
|
|
Hello,
I have a Parent Form and a Child form. In Child form, I perform some search and store the data in Dataset. I want to pass that Dataset in the parent form.
This is the way i have coded
' Parent Form<br />
Private Sub ShowSrch()<br />
srchDt = New SearchForm(mainCon)<br />
srchDt.TopLevel = False<br />
srchDt.Parent = Me<br />
srchDt.SetBounds(0, 30, srchDt.Width(), srchDt.Height())<br />
srchDt.Show()<br />
End Sub<br />
Public Sub SetSearchedDs(ByVal sds As DataSet)<br />
Me.searchedDs = sds<br />
End Sub
In child, I tried Me.Parent. but couldn't find SetSearchedDS(). How do i set this, can anone assist me. Any help is appreciated.
Thanks
Terry
|
|
|
|
|
The "Parent" property just returns a "Form". You have to tell the compiler that you're expecting this object to be an instance of your parent form class.
(Me.Parent As MyParentForm).SetSearchedDs(...)
A better way to do this would be with events. Put this in the child form:
Public Delegate Sub DataSetChangedHandler(ByVal sender as Object, ByVal sds As DataSet)
Public Event DataSetChanged As DataSetChangedHandler
Now instead of calling Me.Parent.SetSearchedDs(sds), you would say:
RaiseEvent DataSetChanged(Me, sds)
Now when you create the search form, you can just say:
AddHandler srchDt.DataSetChanged, AddressOf SetSearchedDs
Now instead of the child form referencing the parent directly, it raises an event which the parent subscribes to, and the parent responds to that event by settings its dataset.
|
|
|
|
|
Thanks Ian, I wrote ur code, but it doesn't work. Can you please tell me, where am I going wrong :
In Parent Form
Public Sub SetSearchedDs(ByVal sender As Object, ByVal sds As DataSet)<br />
Me.searchedDs = sds<br />
MessageBox.Show("Search DS updated")<br />
End Sub<br />
Private Sub ShowSrch()<br />
srchDt = New SearchForm(mainCon)<br />
srchDt.TopLevel = False<br />
srchDt.Parent = Me<br />
AddHandler srchDt.DataSetChanged, AddressOf SetSearchedDs<br />
srchDt.SetBounds(0, 30, srchDt.Width(), srchDt.Height())<br />
srchDt.Show()<br />
End Sub
And in Child Form
' Added these 2 lines along with declarations of otehr vars<br />
Public Delegate Sub DataSetChangedHandler(ByVal sender As Object, ByVal searchDs As DataSet)<br />
Public Event DataSetChanged As DataSetChangedHandler<br />
..... In a method <br />
<br />
' SET DATASET IN THE PARENT<br />
'(Me.Parent as MainForm).SetSearchedDs(searchDs)<br />
RaiseEvent DataSetChanged(Me, searchDs)
Can please assist me. And also
(Me.Parent as MainForm).SetSearchedDs(searchDs)
is showing Compile Syntax error at (
The code doesn't show Search DS updated message box. Additionally, after working with Search Form, I open another for mwher I have set the dataset at the Searched dataset avbl in the Main Form & given a Msgbox over there alos. But none of them work. ????
Thanks
Terry
|
|
|
|
|
Ok, I'm having a bit of trouble understanding what you're saying here...
Try setting some breakpoints, and see where the code is going. Put a breakpoint on the RaiseEvent statement (If it doesn't get to there, you've done something wrong in your code)... From there, it should jump straight to the SetSearchedDs routine. If not, set a breakpoint at the AddHandler and make sure it's hitting that.
And if you're using an On Error Resume Next (*shudder*), shut it off, or you'll never find the problem
Oh, and you're mixing the two ideas... Either use (Me.Parent as MainForm) method OR the RaiseEvent... The event is more standard.
|
|
|
|