|
No i dont know why this is happening i dont know who is mahi@swetha...
actually i have been given a work to develop some thing similar to xpexplorerbar but with an extra option of the header holding controls... thats it i dont know about his work....
|
|
|
|
|
See my reply to honey.pk, a couple of posts above this one.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Mr.Henry,
Thanks for the reply.I viewed ur reply to honey.rpk about my posted thread.But what i need is that i want implement expandable and collapsible features without the use of dock property by which i am able to sort out issue.Also, I saw ur sent link about windows explorer bar or collapsible panel bar few days back itself.Apart from this,We were finding trouble in viewing design part of either of the bars because they are developed using earlier versions of Visual studio.
So,please help me in sorting out this problem.........
Thanks,
With regards,
Mahi@swetha.
|
|
|
|
|
When solutions and projects are built in earlier versions, your current version will convert them very easily. Just follow the wizard. If they will still not convert then use the CP search, Google or Bing to find other, more recent versions.
Stop trying to get other people to do your work for you and buckle down to doing some yourself!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Mr.Henry,
Please dont mistake me to reply u like this.Everytime,u use to reply me more or less like this "Stop trying to get other people to do your work for you and buckle down to doing some yourself!".Iam just posting the thread as iam failed in taking few measures.Bye,Here after,I wont post threads.Thanks for ur suggestion.
|
|
|
|
|
Please do continue to post here. But when you post say "Here is some code I have written. It was supposed to do this but it does that instead, can anyone see what is wrong?" and if the code gives an exception point out the line with the exception and the exact wording of the exception.
You rarely post code, or when you do you post yards of it, no one is going to read all the way through it. You just keep asking "How do I do this" and when people give you links to help you you keep coming up with reasons why you cannot use them.
The only way to learn programming is to do it. So do that, write some code, then ask questions when it goes wrong or just plain doesn't work. But only after you've tried to fix it yourself.
If you are a real beginner, then get some beginners books (there are plenty of free ones on the 'web) and work through them. After that download some source code that does approximately what you want to do and keep working through it till you understand it enough to have a go yourself.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Folks,
My project Structure like below
(Solution)Solution Name
+ ProjectName (Test)
+ Form1.cs
+ Form2.cs
+ Library Project(UI Layer)
+ Usercontrol1.cs
+ UserControl2.cs
how can i call Form1.cs from UserControl1.cs
Thanks & Regards
Nath
|
|
|
|
|
The user control should raise events that the Form (or some form manager class) can subscribe to - much the same as when you put, say, a button on a form. The button doesn't know about the form, but the form responds to the buttons' events but only the ones that it has requested to be informed about.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Using VB.net...
I'm trying to size an in-memory bitmap to fit the text from a textbox. My steps are:
1. Get the height of the font (Font.Height) in the textbox.
2. Get the number of lines in the textbox.
3. Multiply the font height by the line count
4. Size the bitmap to textbox.width and font.height multiplied by the line count for the height
5. Create a rectangle sized to the bitmap
6. Draw the text in the bitmap within the rectangle
7. Set a picturebox's image property to the bitmap (picturebox sizemode set to autosize)
This works fine IF the textbox doesn't have a scrollbar. If it's a long text file, the image is only about half as tall as it needs to be.
Here's my code (RichTextBox named "rtf"):
Private Sub tb_Draw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_Draw.Click
Dim fh As Integer 'font height
Dim cw As Integer 'rtf.width
Dim ch As Integer 'rtf.text height
Dim lineCount As Integer 'rtf.lines.length
Dim bmp As Bitmap
Dim g As Graphics
fh = rtf.Font.Height
cw = rtf.Width
lineCount = rtf.Lines.Length
ch = lineCount * fh
rect = New Rectangle(0, 0, cw, ch)
bmp = New Bitmap(cw, ch, Imaging.PixelFormat.Format32bppArgb)
g = Graphics.FromImage(bmp)
g.FillRectangle(Brushes.White, rect)
g.DrawString(rtf.Text, rtf.Font, Brushes.Black, rect)
picbox.Image = bmp
End Sub
The textbox only uses a single font.
What am I doing wrong?
|
|
|
|
|
I am having trouble with the getModuleFileNameEx api call in a VB.net application. It will not return to me the filepath of the currently active window. Any idea what i am doing wrong?
nextWnd = GetForegroundWindow()
' Gets title and path of the active window
GetWindowText(nextWnd, lpString, lpString.Capacity)
GetWindowThreadProcessId(nextWnd, procID)
modTest = GetModuleFileNameEx(procID, nullWnd, lpFileName, 500)
Thanks,
John
|
|
|
|
|
I'm not sure - I don't do VB. The following works in C# though to get the path of the executing assembly's process
StringBuilder builder = new StringBuilder(500);
uint modTest = GetModuleFileNameEx(Process.GetCurrentProcess().Handle, IntPtr.Zero, builder, 500);
Console.Write(builder.ToString());
[DllImport("psapi.dll")]
static extern uint GetModuleFileNameEx(IntPtr hProcess, IntPtr hModule, [Out] StringBuilder lpFilename, int nSize);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Ok,
After trying the code that you gave me (in a VB.net form), I get the same problem I always get:
When i output the stringbuilder object that should be holding the file path, I get 'Ÿ' followed by the title of the window. And it'll only show up for the first click of the button. So stumped.
Thank you for the help though,
~John
|
|
|
|
|
Hi,
just a hunch: maybe this call won't work as long as the window hasn't been fully initialized (e.g. when the Handle isn't available yet), so don't do this from the Forms' constructor, wait till the Load event.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
The window is fully loaded by the time I execute this code. I have it tied to a timer that'll execute the code once every couple seconds after I hit the timer's start button.
|
|
|
|
|
I don't know why it doesn't work for you. I haven't used VB for a long time but I opened up a ne VB WinForms project and did this and it works fine - the Form's Text displays the path.
Imports System.Runtime.InteropServices
Imports System.Text
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
Text = GetPathOfThisProcessExe()
End Sub
Private Function GetPathOfThisProcessExe() As String
Dim builder As New StringBuilder(500)
GetModuleFileNameEx(Process.GetCurrentProcess().Handle, IntPtr.Zero, builder, 500)
Return builder.ToString()
End Function
<DllImport("psapi.dll")> _
Private Shared Function GetModuleFileNameEx( _
ByVal hProcess As IntPtr, _
ByVal hModule As IntPtr, _
<Out()> ByVal lpFilename As StringBuilder, _
ByVal nSize As Integer) As UInteger
End Function
End Class [Edit] Fixed code formating [/Edit]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Sigh, this is what i HATE and LOVE about programming lol
The thing that made the entire thing work was add .handle to Process.GetCurrentProcess()
Thank you very much for your help as i had been stuck on this for some time now!
Also... what version of VB were you using out of curiosity?
Thanks,
~John
|
|
|
|
|
VB9 (Visual Studio 2008). I used to program exclusively in VB in it's various forms (including VB6 and before!) until about 2 years ago when I decided to switch to / learn C#. I found it comfortable really quickly so I've never had the desire to fire up VB since.
It was very wierd going back. I even had to google to work out how to make a sub handle an event!
Glad it helped - dusted off a few cobwebs for me
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
you can use the result of the function (UInteger) to determine if an error occurred. If there was an error, it will be zero, otherwise the length of the string (path).
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi all
I am new to the site and sorry if I have posted on the wrong forum.
Basically I am a web developer and dealing first time with the windows application.
I need to create a custom printer via coding and add it to the list and made it available to the user whenever the user clicks on the print from the file menu.
I am using visual studio 2005 with vb.net .
Well this is the first step.
please help me. Any clues and suggestions will be highly appreciable.
Thanks
-- Palli
|
|
|
|
|
Your application should not be installing printers at all. This is either a pre-req that needs to be installed prior to running your app, or possibly even something that is installed with your application, but should not be done at run-time. There are plenty of cases where users may not be able to install printers. Since a Windows app runs as the user, it has no more permissions to the system that the user does.
|
|
|
|
|
Can I assume you're not creating a "real" printer, but a virtual one...
sort of similar to the "Send to OneNote" and "Microsoft XPS Document Writer" printers?
|
|
|
|
|
Thanks to all of you for your suggestions.
Ok..I think I should provide enough details to clear the scenario.
I need to create a custom "print to pdf" driver that when installed on a machine would appear in the print dialog of any application. When the users click on the print button, they will have an option to choose this printer. When they choose this printer, it will prompt for a location and then save files there as a PDF file.
Hope that helps.
Looking forward for your replies.
Thanks
-- Palli
|
|
|
|
|
Further research into the topic has cleared the picture more.
I need to develop a virtual printer that would be available to the user in the print list option of any application like word etc, when the user will select the virtual printer, it will ask for the location to save the file and would then save the file on the specified location as a PDF file.
Any suggestions so that I can start working would be highly appreciable.
Thanks
|
|
|
|
|
Hello everyone..
I have managed to add a virtual printer to the printer list.
And now the task is to create a PDF from the added printer.
Any suggestions regarding ?
Could I get the drivers from somewhere for the printer that creates a PDF of the document ?
Thanks
-- Palli
|
|
|
|
|
there is no direct method of doing what you want to achieve in C#
To begin with, you'll need to write your own custom printer driver for your virtual printer to use.
You will need to do a lot of api wrapping, as there is no interface in C# to help you here.
Your best bet is to start looking into the Windows Driver Development kit and see if you can find out
exactly what you need to do.
(and expect to be writing a c++ wrapper too I guess)
|
|
|
|