|
Could someone tell me the name of the "this" pointer in Visual Basic?
Sorry to post such a beginner question, but do you know how hard it is to do a search on the word "this?" ;o)
|
|
|
|
|
|
Use the Me keyword.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I have an app I'm working in which I need to update GUID references based on directory/version. Currently, I can get the current GUID for a dll using TLBINF32. In order to get the GUID, the location of the .DLL must be specified.
Is it possible to determine the GUID based on name only (without specifying the file path)? Something like: GetGuidINFO("somefilename.dll") in which the registry would return the appropriate Guid?
This would be ideal since the location of the .dlls could vary on a system to system basis.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Any ideas on this?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Show some patience. We get to question on OUR time, as volunteers, not on yours. Personally, I've been in meetings all day, so this is the first I'm seeing this.
No, it's not possible to do that, unless the .DLL is in the CurrentDirectory. The problem with CurrentDirectory, though, is that you cannot depend on it to be pointing to any particular directory at any time. It can change, with or without, manipulation from your code.
But, building fully qualified paths to files is also best practice.
|
|
|
|
|
Dave Kreskowiak wrote: Show some patience. We get to question on OUR time, as volunteers, not on yours. Personally, I've been in meetings all day, so this is the first I'm seeing this.
No, it's not possible to do that, unless the .DLL is in the CurrentDirectory. The problem with CurrentDirectory, though, is that you cannot depend on it to be pointing to any particular directory at any time. It can change, with or without, manipulation from your code.
Sorry Dave, didn't mean to come off as impatient. Was hoping I was asking the question in a clear way.
Roger on CurrentDirectory and fully qualified paths.
Thanks!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi,
i create a text file in my code and i want to print the now. origianl file looks like
/********* File Starts Here ***************************
9/22/2008
Name of the customer and details
10010
/********* File Ends Here ***************************
But when i print this file in my project using following code...
Dim pd As New PrintDocument
Dim ps As new PageSettings
ps.Landscape = False
ps.Margins.Top = 0.116
ps.Margins.Bottom = 0.116
ps.Margins.Left = 0.116
ps.Margins.Right = 0.116
ps.PaperSize = New System.Drawing.Printing.PaperSize("A4", 210, 297)
pd.DefaultPageSettings = ps
AddHandler pd.PrintPage, AddressOf pd_PrintPage
and using drawstring function of Graphics as ,
e.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, _
yPos, New StringFormat)
the resulting printout looks like...
/********* File Starts Here ***************************
9/22/2008
Name of the customer and details
10010
/********* File Ends Here ***************************
problem is the first line gets overlapped with second one. i.e date is overlapping "Name of the customer and details" line. which is not actual case.
(so, whole formatting of file is getting lost when i m printing in project but manual file print works fine).
where i am missing something. or is it something to do with saize of paper?
|
|
|
|
|
Sorry folks....
Originas file is like
/********* File Starts Here ***************************
____________________________________________________9/22/2008
_______________Name of the customer and details
________________________________________________________10010
/********* File Ends Here ***************************
and print file format is
/********* File Starts Here ***************************
_____________________________________9/22/2008
_______________Name of the customer and details
__________________________________________10010
/********* File Ends Here ***************************
|
|
|
|
|
I am still not understanding the exact error you are having. In the initial statement you speak of overlapping line segments, and then in the new post, the only problem i see is a smaller amount of underscores for the date and the other number (no overlapping lines). it could just be that the forum is not formatting it the way you are explaining it, but could you still clarify.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Right thomas..
forum is not able to format the space at starting of line. so i have replaced space with underscore.
so, consider underscores as spaces then u can see the diffrence between original file and printed version. the number of spaces in print is less than that of original.
here note that, when i print file in notepad directly its giving proper print. but same file when i print through application, its minimizing the number of spaces that makes me beleive that its formatting or page setting issue in application.
Any Help ?
|
|
|
|
|
I ressolved the issue.....
For anyone who are intrested...
When u try to print the file in vb.net with preceding space characters, then
in print u dont get same number of spaces(actually number of spaces are same but width of total space gets reduced)
To overcome this problem, u have to use font like "Courier New" which having same width for all characters. as ,
Private printFont As Font
printFont = New Font("Courier New", 10)
e.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, _
yPos, sFormat)
The scenario is when positioning of printed string on paper does matter a lot..
Cheers !
|
|
|
|
|
That's because when you printed the test, you used a proportial spaced font. When you used Courier New, you started using a fixed space font. Proportial means that each character uses just the amount of space it needs to get rendered. For example, a 'W' needs more width than a '.' to render. In a fixed space font, every character uses the same amount of space when rendered, regardless of how much it actually needs.
|
|
|
|
|
yes dave.
but can i use proportial spaced font and still make them cover fixed sized width. may be by adjusting the width of whole string?
any idea?
|
|
|
|
|
kedarrkulkarni wrote: can i use proportial spaced font and still make them cover fixed sized width.
Not easily. You'd have to draw the text, line-by-line and word-by-word, yourself, adjusting the space between words to make the text justified between the margins.
|
|
|
|
|
how can i mention the width of space betwwen the two characters while drawstring()
Any idea?
Thanx for reply...
Cheers !
|
|
|
|
|
You can't. You can set the spacing between all characters in the string, but not between any two arbitrary characters. Like I said, if you want to do margin justified text, you'll have to drwa each individual word, keeping track of the position of each word and calculating the space needed between them.
|
|
|
|
|
Damn this dial-up and AOHell, I was just about to post the same solution you found not more than 5 minutes ago. Still glad you found the solution though
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi
I created a windows application in which I added a MDI form .
When I clicked on a button in MDI parent form I want to get a child form to be opend and the parent form has to be disabled.But I am getting both as enabled.I written the following code fot that
.
Form frmChild =new Form();
frmChild.MdiParent=this;
frmChild.show()
can any one suggest me what more I have to do to get the desired result.
Thanks in Advance.
|
|
|
|
|
use following statement
frmChild.showDialog()
in place of
marygoldg wrote: frmChild.show()
hope this helps
|
|
|
|
|
If You are Using a MDI form and a Normal Form, then Always two forms are enabled.
because, other form is opened with in the MDI form
Arindam Banerjee
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
MDI standards for Multiple Document Interface. Say you were creating a new version of Notepad, where you were able to open multiple documents in the same editor window. That editor window is the MDI Parent form and the documents are the MDI children. You cannot disable the MDI Parent form and keep the child forms enabled. Otherwise, the children forms will also be disabled.
It sounds like you should not be using an MDI Child form, it should be its own form.
|
|
|
|
|
When I clicked on a button a form is getting opend with in the MDI parent forms.But the problem is the controls on the parent form are hiding the controls on the child form.I could not able to find out where the mistake is .Could you please suggest .
|
|
|
|
|
The mistake is in your design combined with not understand how MDI works.
MDI Parent forms have a control on them, automatically, that takes up the entire client area of the form. This control is called the MDIClient (the dark gray area) and it sits docked to all of the free space on the form. It also sits behind all other controls on the form. This control handles rendering and management of all of your MDI Child forms. When you create a child form, it gets shown inside this MDIClient control.
Now, since the MDIClient control sits behind all other controls on the MDI Parent form, this is why you're getting the results you're seeing. The quick solution is simple, don't put controls on the MDI Parent form.
The harder solution is to, in code, find the MDIClient control in the MDI Parent form's Controls container, undock the MDIClent control, move the MDI Parent controls to the edge of the form, then set the Location and Size properties of the MDIClient to somewhere where your MDI Child forms will still be visible and you can still get to the MDI Parent controls.
|
|
|
|
|
I need some help with saving and retrieving images with microsoft sql server.
I have created a form that captures personal information and a picture.
I am having problems with how to saving this data with the picture.
I will also like to display this data at a later time or in another form.
Please help.
|
|
|
|
|