|
Try understanding and working with delegates or another approach is to pass current form's reference to other form from which your trying to control form.
|
|
|
|
|
Hi,
I'm experiencing a problem when printing text using Graphics.DrawString(). The horizontal character spacing appears inconsistent for each line of text, depending on the length of the string printed. It's pretty hard to explain what exactly is happening, but for instance, when printing:
Info::Defining 'FORCEBUILD' as 'False'
Info::Defining 'BUILDGLOBALDATA' as 'True'
Info::Defining 'BUILDTRACKINSTANCES' as 'False'
Info::Defining 'BUILDTRACKDYNAMICOBJECTS' as 'False'
Info::Defining 'BUILDTRACKSTATICOBJECTS' as 'False'
Info::Defining 'BUILDPAKFILES' as 'True'
Info::Defining 'BUILDGUIFILES' as 'False'
Info::Defining 'BUILDAICHARACTERSKINS' as 'False'
Info::Defining 'BUILDDRIVERCHARACTERSKINS' as 'False'
The first column of ' characters after Defining are aligned differently horizontally.
This is using the controls standard font MS San Serif 8.25, with all the system default text rendering settings.
I've tried changing the TextRenderingHint in the Graphics object, and found that TextRenderingHint.SingleBitPerPixel gives a consistent alignment, but looks awful, where the default seems to be TextRenderingHint.SingleBitPerPixelGridFit, (although TextRenderingHint.AntiAliasGridFit looks the same to me), giving the mis-aligned text.
[EDIT: In addition to this issue, when printing multi line text as above, the vertical spacing for each line of text is not consistent, ie. the vertical distance between each line of text is not the same number of pixels, some are 12 and some are 13 pixels, suggesting underlying floating point math.]
Any advice appreciated.
Cheers,
Andy.
modified on Thursday, April 24, 2008 6:44 AM
|
|
|
|
|
Hi all,
i am facing one problem in my windows application,
DateTime days;
DateTime day1;
DateTime day2;
day1 = (Convert.ToDateTime(dtdata1.Rows[0]["firstrepaymentduedate"]));
day2=(Convert.ToDateTime(dtdata1.Rows[0]["trenchdate"]));
decimal interestrate;
int outstandingamount;
decimal interestamount = (outstandingamount * interestrate * days) / 365;
here days is in datetime but interestamount is decimal.
so we are getting error in converting datetime to decimal
please any body knows this solution please give reply to me as soon as possible
thanks & regards
sarp
sarp
|
|
|
|
|
Use TimeSpan.Days.
also don't ask us to reply as soon as possible...
|
|
|
|
|
Hello All,
I Have One form when I click button There another form contain login when user click button ok it check user name and password if it is correct it is close login form
How can I do That, Please.
|
|
|
|
|
|
Hi All,
how to freeze the column in listview.for exe: click the listview header,left hand side of the selected column will remain static and visible, especially when the user scrolls right across the table/row to view columns currently out of view.
Thanks,
aravindakumar
|
|
|
|
|
Hi all,
I have 2 forms , formMain and formChild. What i wanna do is when the mouse is leave the formChild then it will become tranperancy. When the mouse move over the formchild then transperancy become 1 again.How can i archive it?
Any tips are welcome.
Thanks in advance
regards
cocoon
|
|
|
|
|
There's a mouse leave event, or you can capture the mouse and detect from it's move event when it left your form.
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 )
|
|
|
|
|
Hi Christian,
Thanks, i got it
|
|
|
|
|
I have a problem in running application in remote desktop. In remote desktop 'Display' tab if i set color option as 'High color (16 bit)' my application is giving an error message like "Will not be able to display color images with these settings". So we have set 'True color (24 bit)' option. But in this case the application is working fine in some machines. In some machines the options gets changed automatically to 'Medium (16 bit)' and the application shows the same error message. OS used is Windows XP in all the machines.
Can somebody help me in solving this issue?
|
|
|
|
|
Hi All,
Is there any way of converting the windows form design to pdf format. The pdf format can contain only the text of each and every control in the form. I have explained the scenario more briefly in the following section :
I have a windows form(partially big) where the user will enter the details for each and every field. On clicking of the print button i should transfer the form design view to the pdf file and shd open that pdf file with the given data.
Is there any way to acheive this directly or indirectly.
Thanks in advance
Cheers
Mani.
|
|
|
|
|
You can just download a printer driver that spits out PDFs.
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 )
|
|
|
|
|
Hi Graus,
Can you pls bit more clear...
Regards,
Mani.
|
|
|
|
|
I'm not sure how to be more clear. It's possible to download a printer driver, from the web, which, when you print, will create a pdf of the printed document.
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 )
|
|
|
|
|
My requirement is to convert the windows form into a pdf document with certian rules which i have given in my question.
If u need any clarification pls let me know...
Regards,
Mani.
|
|
|
|
|
Your other option is to buy a PDF library and get the form to render to a bitmap ( the form class has a method for this ). But that will only render the visible area, if the form has any scrollable sections. Then you can turn the bitmap into a PDF.
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 tried ur option of transferring the form to bitmao and what you said is right it copies only the visible portion of the form. I need to copy the entire form. How this can be done.
Regards,
Mani.
First have the WILL then u WILL
|
|
|
|
|
If you need to draw the form, you probably need to scroll it and stitch it together. The usual way tho, is to implimnet printing code and write the code to represent all your data as you see fit.
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 )
|
|
|
|
|
can you pls give me an idea of implementing the printing code.
First have the WILL then u WILL
|
|
|
|
|
We often see in some softwares that when we run them, the main screen becomes dark, and a pop up message comes in front of us demanding for user name and password. At that time if we click the screen(form) behind that login dialog box, it is not click able. Once the application verifies user name and password, the screen(form) behind becomes click able. How can we implement this ?
|
|
|
|
|
Hi,
- Set the Form.Enabled property to false.
- Create a new form and show it (for the username and password etc).
- When you create this new form add an event handler for when it closes (in the parent form).
- If the event handler method, set the Form.Enabled property to true.
Cheers,
|
|
|
|
|
Thanku so much. There is one more thing i want to ask. How can i make that login (mini) form (which just contains username, password field + two buttons) detached from the taskbar. I mean it should not be present on the taskbar. It should be dependent on the previous form. For example, have a look at this screenshot http://cs.gift.edu.pk/~tamour/form.jpg
modified on Wednesday, April 23, 2008 3:49 PM
|
|
|
|
|
Running on Windows Vista as a standard user? That's the UAC administrative password prompt, which runs on a secure desktop. That actually has a different wallpaper from your regular desktop, but to preserve the illusion Windows Vista makes a copy of the screen then dims it to use as the background. You might also see that password prompt, rather than the Confirm/Deny dialog, if your administrator has chosen that for administrative user elevations.
If your application actually requires administrative privileges to do what you're doing, then add a UAC manifest to set the requestedExecutionLevel to requireAdministrator. Windows will then prompt for administrative credentials to execute the program.
If instead you want to capture your own credentials, rather than Windows logon credentials, call CredUIPromptForCredentials . This won't do the 'secure desktop' thing. The only way I can see to do that is to call CredUIPromptForWindowsCredentials and use the CREDUIWIN_SECURE_PROMPT flag, but even that is called out as 'not supported' for Windows Vista. Must be new in Windows Server 2008.
An approach we've used before on Windows Mobile is to create a window that covers the entire screen and is topmost, but the user can still press Alt+Tab to switch away from it.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|