|
I am having a problem building a menu bar. My mdi parent loads a child form anchored to the left and top within the form load. This is to be my menu bar. Originally the client wanted the buttons on the menu bar (total of 6 buttons) to produce a submenu under the last button in the menu. The submenu would of course have options for whatever main menu button was clicked.
Now the client (now being several stages into development) would like the submenu (6 seperate panel controls populated with link controls) to appear to the right of the main menu item that was clicked.
Not a problem I thought... I had to extend the width of the menu bar to accomodate the width of the submenu and move them around a bit.
BUT now if there are other child windows open when the submenu appears, they are covered by the background of the main menu.
I tried making the bg of the mainmenu transparent, but then the desktop, not the MDI parent bg is visible.
So I created a transparent .gif, made that the backgroundimage for the mainmenu and got the same result as above.
Do I have to repaint the MDI Parent BG?
Has anyone ran into something similar?
All I want is the submenu to appear without the BG accompanying it.
Sorry for the long post, but it is about as best as I can explain it.
|
|
|
|
|
Beginning to think that this is not possible.
If I apply transparency to a MDI child, the same region within the parent form also becomes transparent (desktop visible).
|
|
|
|
|
OK so here was my way around it. Just never mind about transparency...
Used an owned form instead.
At the form level:
Public WithEvents subnav As New System.Windows.Forms.Form
and within the load event of my main menu:
<br />
'add the owned form to the MDI parent<br />
F1.AddOwnedForm(subnav)<br />
'a little config<br />
subnav.FormBorderStyle = FormBorderStyle.None<br />
subnav.Text = ""<br />
subnav.Width = 150<br />
subnav.Height = 100<br />
'moves it to the extreme right of the main menu<br />
subnav.Left = nav.Panel1.Width<br />
<br />
subnav.Top = 100<br />
subnav.BackColor = Color.AliceBlue<br />
And in the main menu buttons:
<br />
'Adds the existing panel from the main menu.<br />
'This kept me from having to move code and controls etc...<br />
subnav.Controls.Add(nav.Panel2)<br />
<br />
subnav.Controls.Item(0).Visible = True<br />
subnav.Controls.Item(0).Left = 0<br />
subnav.Controls.Item(0).Top = 0<br />
subnav.Show()<br />
There are probly better ways to do this, but....
It works. And the link control events within the added panels still behave as they should. Again, without rewriting or copying and pasting...
|
|
|
|
|
i need urgent help on my project.. i need to browse for an exe and add a new menu item. i want to run that exe by clicking that menuitem... pls help... i cant find a way to handle the event..iam not able to pass arguments to the event handler.. pls help me.....!!! thanks
|
|
|
|
|
several ways of accomplishing it....when you create the menuitem put the exe filename in the tag field ... handle all that type of menuitems handlers together and run the shell command with the tag field as exe filename
|
|
|
|
|
|
I wanted to read the version of a DLL through VB6. Please try and give a detailed description (or some example code) on how to do it.
I went through a similar article here. But since I am relatively new to handling assemblies in VB6, request you kindly elaborate on the solution.
Cheers,
Nagu
It does not matter WHAT you Say.
It does not matter WHEN you Say.
The only thing that matters is HOW you Say.
Cheers,
Nagu
|
|
|
|
|
|
Thats just what i wanted... Thanks a lot
Cheers
Nagu
|
|
|
|
|
Hello,
How to create a xml file through programming and populate data into that xml file at runtime?
Thanks & Regards,
Mythri
|
|
|
|
|
your question is very generic to me, thus the reply may be not exactly what you were looking for.....
1) create a dataset to hold the data (at design time or run time)
2) populate the dataset
3) save it to an xml file
let's suppose you created a dataset called a with a table called b and a single text field named c
dim ma as new a ' create the dataset
ma.b.addbrow("test") ' populate it
ma.writexml(filename) ' save it to xml
Briga
|
|
|
|
|
Hello,
How to create a xml file through programming and populate data into that xml file at runtime?
Thanks & Regards,
Mythri
|
|
|
|
|
Hello Friends,
Is it Possible in Windows Application To Upload a File to a Remote Server.Please Help soon If Possible.
hiiiiii
|
|
|
|
|
Of course. But, everything dpends on what type of server you're uploading to, ...which you didn't say anything about.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I wonder if someone has the knowledge I lack, I am trying to resolve a hostname through a proxy server in vb.net but I am figure out how to combine these subroutines?
This sub is to give a proxy server some credentials and download the html from the page
Warning **** imports system.net at top of code ****
Private Sub Myproxy()
Dim result As String = ""
Try
Dim proxy As WebProxy = New WebProxy("http://proxy:80/", True)
proxy.Credentials = New NetworkCredential("username", "password", "domain.com")
Dim request As WebRequest = WebRequest.Create("http://www.c-sharpcorner.com")
request.Proxy = proxy
Dim response As HttpWebResponse = CType(request.GetResponse, HttpWebResponse)
Dim stream As System.IO.Stream = response.GetResponseStream
Dim ec As System.Text.Encoding = System.Text.Encoding.GetEncoding("utf-8")
Dim reader As System.IO.StreamReader = New System.IO.StreamReader(stream, ec)
Dim chars(256) As Char
Dim count As Integer = reader.Read(chars, 0, 256)
While count > 0
Dim str As String = New String(chars, 0, 256)
result = result + str
count = reader.Read(chars, 0, 256)
End While
RichTextBox1.Text = result
response.Close()
stream.Close()
reader.Close()
Catch exp As Exception
Dim str As String = exp.Message
End Try
End Sub
This is the sub to resolve the hostname
Public Sub DisplayHostAddress(ByVal hostString As [String])
Try
Dim hostInfo As IPHostEntry = Dns.Resolve(hostString)
' Get the IP address list that resolves to the host names contained in the Alias
' property.
Dim address As IPAddress() = hostInfo.AddressList
' Get the alias names of the addresses in the IP address list.
Dim [alias] As [String]() = hostInfo.Aliases
MsgBox(("Host name : " + hostInfo.HostName))
'MsgBox(ControlChars.Cr + "Aliases : ")
Dim index As Integer
For index = 0 To [alias].Length - 1
MsgBox([alias](index))
Next index
'MsgBox(ControlChars.Cr + "IP Address list :")
For index = 0 To address.Length - 1
MsgBox(Convert.ToString(address(index)))
Next index
Catch e As Net.Sockets.SocketException
MsgBox("SocketException caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
Catch e As ArgumentNullException
MsgBox("ArgumentNullException caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
Catch e As NullReferenceException
MsgBox("NullReferenceException caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
Catch e As Exception
MsgBox("Exception caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
End Try
End Sub
so for example to resolve:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.DisplayHostAddress("http://www.codeproject.com")
End Sub
thanks
|
|
|
|
|
I want my VBScript to stop for 4 seconds before starting again.
Searched the web and found this "WScript.Sleep 4000".
The problem is that when I use this code i get an error "Object required 'WScript'".
What is wrong?
Is there a better way to do this?
Spaz
|
|
|
|
|
It should be:
WScript.Sleep(4000)
If your running your script under CSCRIPT.EXE or WSCRIPT.EXE, nothing else is required.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello friends
i need help for using unicode & ASCII code using in vb-6
for language conversion and enabling right-to-left language
conversion code e.g. English to Arabic or induan punjabi
Charactor conversion or designing Arabic & punjabi Controls
or formats
zain
|
|
|
|
|
hi friends
i need help for call .lib & .cab files in visual basic-6 projects
zain
|
|
|
|
|
You don't makes calls into these types of files. A .lib file is something C/C++ gets compiled with and a .cab file is a compressed "cabinet" file, like a .ZIP file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi !
I need to write a VBScript which would launch a command application (nmake, not to name it) and I'd like that the output produced by nmake being displayed in the command window from where I launched the VB Script.
I did some googling but didn't find anything which works...
Any idea ?
Thanks !
Jerome
|
|
|
|
|
I add a system.data .net reference in project , and use these code in a winform.
imports system.data
Dim theData As DataTable
^^^^^^^^^ ---- Error!
Why?
|
|
|
|
|
Did you add a reference to system.data.dll in the solution explorer?
|
|
|
|
|
I tried to set the printpreviewdialog.showdialog to fullscreen,including set top=0, left=0, width=screen....width,height=screen...height.
However,the top is always not 0 acturally.
Why?
|
|
|
|
|
have you tried to set the windowstate property?
Briga
Dim a As PrintPreviewDialog
Public Sub test()
a.WindowState = FormWindowState.Maximized
End Sub
|
|
|
|