|
I don't do Office Interop or extensions, but it would seem that you have to attach the VS debugger to Word before you try to lanuch your Add-In.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Does anyone know how to adjust the speaker balance while playing a sound?
-- modified at 23:27 Saturday 16th December, 2006
P.S. Not using DirectX...preferably using Windows API.
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Are you embedding Windows Media Player in your program to play sound?
|
|
|
|
|
At the moment im using
Private Declare Auto Function mciSendString Lib "winmm.dll" (ByVal cmd As String, ByVal ret As StringBuilder, ByVal retLen As Integer, ByVal hwnd As IntPtr) As Integer
that way I have the option of using a player...or just a sound
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
There has to be an API for doing this in windows...sndvol32 does it in XP...Maybe I should look for the command line arguments for it, but then it would make the app XP dependant....hmm what to do what to do
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
All,
I've created a timer program that when it ends, displays a password form (no border) via showdialog that is maximized when displayed. The form contains one group box that holds my text box to enter the psw in and an enter button to confirm.
My problem is that I won't know what resolution a person screen may be set to and when the form loads on their PC, I want the group box to be centered in the middle of the form to ensure it will always be visible.
I know it sounds simple (probably is), but I can't seem to get the group box to center when I try different resolutions. My fear is that if I don't get it to center, it may very well show too far off to one side on someones computer and they will not be able to do anything but shutdown. Plus centered looks must more professional as well.
All help is greatly appreciated!
Thanks, everyone.
- Harold
|
|
|
|
|
Private Sub Form1_ResizeBegin(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize<br />
Dim x As Integer = CInt((Me.Size.Width / 2) - (Me.GroupBox1.Width / 2))<br />
Dim y As Integer = CInt((Me.Size.Height / 2) - (Me.GroupBox1.Height / 2))<br />
<br />
Me.GroupBox1.Location = New Point(x, y)<br />
End Sub
The height seems to be offset, but this might get you closer to your answer.
|
|
|
|
|
That did it!!
Thank you very much.
- Harold
|
|
|
|
|
The height will be offset because you have to accomodate for the titlebar(which is normally 30 pixels) and the bottom edge(which is normally 3-4 pixels).
Posted by The ANZAC
|
|
|
|
|
Thanks. Do you know of a property for the client area only?
|
|
|
|
|
Ok, i've come up with this:
Dim y As Integer = Me.Bounds.Height / 2 - Me.GroupBox1.Height / 2<br />
Dim x As Integer = Me.Bounds.Width / 2 - Me.GroupBox1.Width / 2<br />
Me.GroupBox1.Location = New Point(x, y)
This will center your control, in this case, a groupbox within the forms client area. However ther may be one drawback (depending on how you see it). If you have a docked menu at the top of your form, the control will center itself between the bottom of the form and the menu. I'm guessing the same goes for any docked menu on any side. Other than that, i think this works quite well.
Posted by The ANZAC
|
|
|
|
|
Hi,
I have to import data from .csv file (which contains 4 different columns like firstname,lastname,DOB,SSN) into Oracle database by using vb.net and asp.net(web application). This .csv file is very bulky file which may containts upto 10,000 rows.
Can any body tell me that what is the faster way to do it thru web page.
Any sample code or link is available which solve this issue than it would be very much helpful to me.
regd,
montu3377
|
|
|
|
|
Hi, I have an old laptop which is running windows xp professional. I have a problem with my keyboard that the M and N key seem not to be funtion sometime. I need to press it very hard in type M or N character.
If I work in windows, it doesn't has any problem becuase I could use the utitlity call On screen keyboard to type this character. But when I start logon or my computer is lock and need to unlock and this key is the part of my password or username, it is really make me in trouble.
From here, I would like to write my own software or find any software that attach itself to winlogon.exe which consist of small button if i could not type my keyboard they i will use this button to load an on screen keybaord or other tool that i could click on the character that I could not type. I used to use windows xp tablet pc edition and i found that Microsoft have attach the keybaord button for user to use the pen to type it.
Does anyone has any idea?
|
|
|
|
|
The winlogon.exe is a Microsoft Windows program that has the key functionality of the logon interface. I do not believe it will be possible or wise to alter or enhance the program that may leave security holes in the OS (I have know idea whether what you are thinking will or will not, but it is still a possibility). Their are some programs that I know add some functionality to the winlogon.exe program to customize the interface or add alternative login forms (examples: fingerprint reader or LogonStudio from a Windows Skinning company), but I don't know how exactly they do it.
It may be easier to just change the password or username. Or for that matter get a new keyboard if the keyboard is really interfering with your productivity.
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 homepage Oracle Studios[ ^]
|
|
|
|
|
Thank you very much for your suggestion. I think I might use automatic logon when my keyboard came to normal. I can't purchase an external keyboard because sometime I need to make a presentation with this laptop on the road.
Thank again for your suggestion. Happy new year!!!
|
|
|
|
|
It's a heck of a lot easier to replace the keyboard or just buy ($10 US) a normal desktop keyboard and plug that into the laptops keyboard port.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you very much for your suggestion. But my computer need to present in the public, so I can't purchase additional keyboard because it would make me difficult to bring it with me when i travel. Now I decide to use automatitc logon to my computer when the keyboard become normal. Thank you and happy new year!!!
|
|
|
|
|
I have a click event for multiple buttons
i.e but1, but2, but3, etc...
Private Sub Buttons_Click(ByVal sender As System.Object, ByVal e as System.EventArgs) Handles but1.click, but2.click, but3.click
End Sub
(you get the idea)
What I want to do is determine the exact button that was clicked.
I tried this...
dim con as new control
if con.gettype.name = "Button" then
output.text = con.text
end if
obvisously no luck.
Any pointers for a novice?
|
|
|
|
|
tbryce311 wrote: I tried this...
dim con as new control
That will only create a new unused control, that has nothing to do with any of the controls in your form.
The sender argument contains a reference to the control that caused the event. Cast it to the type of your control.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Again I am a novice... so I am trying to understand the concept/terminology of what is going on here.
The sender is system.windows.forms.button
Under control it is System.Windows.Forms.Control.ControlCollection
Assuming I am following the information that you wrote correctly the control that would have caused the event would be Owner/Name: "but1"
There is not a type listed under the Control.ControlCollection.
I do not follow "Cast it to the type of your control"
|
|
|
|
|
If your button click event handler:
If TypeOf (sender) Is Button Then
Dim cb As Button = DirectCast(sender, Button)
' Do whatever you want with the button. cb is
' now the button that was clicked.
End If
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The sender parameter is a reference to the instance of the control that caused the event, not just the type of the control.
If the sender is a Button, cast the reference to Button, and you have a reference to the button that was clicked:
Button senderButton = DirectCast(sender, Button)
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
if(((Button)sender).Text="Button")
{
output.text=((Button)sender).Text;
}
or
Button con=(Button)sender;
if(con.Text="Button")
{
output.text=con.Text;
}
You don't have the con variable defined so I am assuming the event handlers object paramter is sender. The code is in C#, but you should still get the general idea.
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 homepage Oracle Studios[ ^]
|
|
|
|
|
Hi I have the following code that hides a drive depending on the check status.
Private Sub Hide_Drive()<br />
<br />
Dim DriveStr As String = ""<br />
Dim Regkey As RegistryKey<br />
Dim DArr As New ArrayList<br />
Dim i As Integer<br />
Dim Cnt As Integer = 0<br />
<br />
For i = 0 To Chlsb_Drives.CheckedItems.Count - 1<br />
Select Case Chlsb_Drives.CheckedItems(i).ToString()<br />
Case Is = "A"<br />
Cnt += 1 : DriveStr &= "A"<br />
Case Is = "B"<br />
Cnt += 2D : DriveStr &= "B"<br />
Case Is = "C"<br />
Cnt += 4D : DriveStr &= "C"<br />
Case Is = "D"<br />
Cnt += 8 : DriveStr &= "D"<br />
Case Is = "E"<br />
Cnt += 16 : DriveStr &= "E"<br />
Case Is = "F"<br />
Cnt += 32 : DriveStr &= "F"<br />
Case Is = "G"<br />
Cnt += 64 : DriveStr &= "G"<br />
Case Is = "H"<br />
Cnt += 128 : DriveStr &= "H"<br />
Case Is = "I"<br />
Cnt += 256 : DriveStr &= "I"<br />
Case Is = "J"<br />
Cnt += 512 : DriveStr &= "J"<br />
Case Is = "K"<br />
Cnt += 1024 : DriveStr &= "K"<br />
Case Is = "L"<br />
Cnt += 2048 : DriveStr &= "L"<br />
Case Is = "M"<br />
Cnt += 4096 : DriveStr &= "M"<br />
Case Is = "N"<br />
Cnt += 8192 : DriveStr &= "N"<br />
Case Is = "O"<br />
Cnt += 16384 : DriveStr &= "O"<br />
Case Is = "P"<br />
Cnt += 32768 : DriveStr &= "P"<br />
Case Is = "Q"<br />
Cnt += 65536 : DriveStr &= "Q"<br />
Case Is = "R"<br />
Cnt += 131072 : DriveStr &= "R"<br />
Case Is = "S"<br />
Cnt += 262144 : DriveStr &= "S"<br />
Case Is = "T"<br />
Cnt += 524288 : DriveStr &= "T"<br />
Case Is = "U"<br />
Cnt += 1048576 : DriveStr &= "U"<br />
Case Is = "V"<br />
Cnt += 2097152 : DriveStr &= "V"<br />
Case Is = "W"<br />
Cnt += 4194304 : DriveStr &= "W"<br />
Case Is = "X"<br />
Cnt += 8388608 : DriveStr &= "X"<br />
Case Is = "Y"<br />
Cnt += 16777216 : DriveStr &= "Y"<br />
Case Is = "Z"<br />
Cnt += 33554432 : DriveStr &= "Z"<br />
End Select<br />
Next<br />
'save drives' setting in registry<br />
Regkey = Registry.CurrentUser.CreateSubKey("Software\Hide Drive")<br />
Regkey.SetValue("Cnt", Cnt)<br />
Regkey.SetValue("Drives", DriveStr)<br />
Regkey.Close()<br />
' Update registry key<br />
Regkey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", True)<br />
Regkey.SetValue("NoDrives", Cnt)<br />
Regkey.Close()<br />
<br />
End Sub
I can't figure out how to check the items back when I load the form.
Can someone help?
Thank you
|
|
|
|
|
guayony wrote: I can't figure out how to check the items back when I load the form.
What do you mean check the items back???
|
|
|
|