|
Hi Henry Minute
You are correct to some extent.
I need a control of almost an explorerbar but what i need is in a explorer bar i can not add any controls to the header, i can just change the text of that. But i need a control which works like an explorer bar but with an extra feature of holding some controls of any type(eg.. Button, panel, textbox).
I think you got the point what i my aim is to do...
If not i will explain you some more detailed an clear manner... if you come back to me..
Thanks & Regards.....
|
|
|
|
|
honey.rpk wrote: But i need a control which works like an explorer bar but with an extra feature of holding some controls of any type(eg.. Button, panel, textbox).
The reason that I pointed you to the article that I did, and gave you a search term is that those controls all perform the collapsing of the panels and moving the others to remove the empty spaces. All you have to do is to use the panel control that you already have and the code for avoiding excessive empty space from the ExplorerBar and put them together.
If you have any hopes of becoming a programmer this is the sort of thing that you must learn to do.
If you cannot follow the code in the link I gave, do a search, pick one or two of the others and work through the code in them. After that you should at least have some idea about how to do it, then have a go at building your own.
I'll give you a clue: In most of them it is the Bar that holds the panels that moves the panels. There is nothing to stop you from allowing these bars to hold other controls.
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.”
|
|
|
|
|
|
What problems are you having while trying to do this? I don't think many are going to just hand over complete code, but if you cite a specific area where you are having issues, and show some problematic code, then you may get more help.
Also, if you are just trying to open a file from a server then why are you using a web service? I would think you can configure things to just open the file directly. BUT, keep in mind that a file that is 1GB is size will be ridiculously slow to open over a standard Internet connection. In this case a web service MAY help if you can open the file on the server side and send the content up to the client in chunks. However if you plan to have multiple people access this file, and you need to be able to do updates and stuff, then you will more than likely have some concurrency issues.
Perhaps some more detail about what you are trying to ac hive is also a good thing.
|
|
|
|
|
My friends,
I request u to help me in sorting out a solution for a usercontrol made up of two panels.I like to implement expandable and collapsable features to usercontrol.So that the child controls or usercontrols placed below it should shift upwards and downwards along with the shift of usercontrol.
In the same usercontrol,if i want to resize the usercontrol at design time.how can i do it?
|
|
|
|
|
There are remarkable similarities between your post and this[^] one here.
Looks like a case of multiple user id of same person to me.
|
|
|
|
|
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
|
|
|
|