PowerPoint SaveAs synchronized? Hi,
Since I've got no reply I was thinking maybe this is not a specifically VB .NET question. Could anyone direct me to a more suitable category in the MSDN forum if there is one.
Thanks,
Bitula Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
turning a "textbox" into a "numberbox" are you just wanting numeric data to be entered into a textbox if so then you need to check the key pressed in the KeyPress event of the textbox. Example:
private sub Textbox1_KeyPress(byval sender as object, byval e as KeyPressEventArgs) handles Textbox1.KeyPress
if Char.IsDigit(e.KeyChar) = false AND Char.IsControl(e.KeyChar) = false then
'cancel the input
e.Handled = true
end if
end sub
you should also use the Convert class to convert to your data type you like rather than using the old VB methods. Convert.ToDecimal( StringInput ) for example ;-) Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
serial port in C# (Overflow in hex? ASCII?) The default encoding used by SerialPort is ASCII. That encoding doesn't support codes higher than 0x7F. The best way to avoid this issue is to read and write bytes, not characters. Makes you code a lot easier too, you don't have to do all the string conversions. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
menustrip combobox Hi,
Can you decribe how you got this problem step by step Or give some other clues
I can't reproduce the error here.
Thank you Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Variable Array identifiers First, you can't find a variable from its name. The name is used in your code, it is not available at runtime.
Second, don't use System.Array as a Type. You should use Form() or String() or whatever the array is of.
If you need to store three arrays of Forms and refer to them by name then you would have to do...
Code Snippet
Public Class Form1 Public AllTempTabs(9) As Form Public AllListTabs(9) As Form Public AllEventTabs(9) As Form Public AllTabs As New Dictionary( Of String , Form()) Sub New () InitializeComponent() ' Store the Form arrays in the dictionary, ' the string acts as a key to retreive a ' specific array. AllTabs.Add( "AllTempTabs" , AllTempTabs) AllTabs.Add( "AllListTabs" , AllListTabs) AllTabs.Add( "AllEventTabs" , AllEventTabs) End Sub Sub MakeNewTab( ByVal tabName As String ) Dim currentArray() As Form = AllTabs( "All" & tabName & "Tabs" ) End Sub End Class Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
hold down key Well one way would be to use the ModifiedKeys that is a static member of the Form class: if ( ( Form.ModifierKeys & Keys.Control ) == Keys.Control ) { } so you're code would be: if ( e.Button == MouseButtons.Right && ( ( Form1.ModifierKeys & Keys.Control ) == Keys.Control ) ) { } another way would be to turn on KeyPreview on your form, and inside the Form's KeyDown event, set a flag to indicate Control (Ctrl) is held down, then on KeyUp event clear the flag. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Why To Not Use Threading.Sleep in Your Application I just wanted to say thank you reneec
I really appreciate the explanation, i would really like to see more info on other points as well.
So many times i see - don't do this or don't do that. And the answer although really long, does not quite explain why.
And that may also be because the answer is over out heads.
This thread is a perfect example for many: it shows you what you shouldn't do and now here is how you should do it.
And why not to do it is explained very well.
And even better it has "Real World" examples.
Wonderful
Many times i feel like the knowledge that you more experienced programmers have is just sitting idle and teased by throwing simple code bits at us. Which many times that's what were askin for. And even though it gets you to the next point, many don't even know how or why it works. It just does. And i see the frustration all the more experienced have when us beginners just don't get it. Even though the answer you gave is the right one, we are still looking for the answer even though you gave it because we just don't understand how to put it together.
Thanks again, hope to see more. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
how to convert Date to Integer DateTime.Subtract() subtracts two dates. So does Date.Subtract(). It produces a TimeSpan instance, use any of its properties to measure the difference. The Ticks property is the most accurate but you'll probably want to use something like TotalSeconds or TotalDays. The VB.NET DateDiff() function produces a Long value (not Integer). For example: Dim diff As Integer = CInt(DateDiff(DateInterval.Second, d1, d2)) Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Move to cell in previous row? Use the datagridview keypreview event to capture the keys. Look for up and down keys.
The datagridview is arraigned in terms of rows and columns. For an up key, you want to get the index of the curently selected row and column. and if the row is greater than zero decrement the row index by obe and select the cell. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Drawing a line one pixel at a time Hello,
You can use Bitmap object SetPixel function.
Sample code from MSDN:
Code Snippet Public Sub SetPixel_Example(ByVal e As PaintEventArgs) ' Create a Bitmap object from a file. Dim myBitmap As New Bitmap("Grapes.jpg") ' Draw myBitmap to the screen. e.Graphics.DrawImage(myBitmap, 0, 0, myBitmap.Width, myBitmap.Height) ' Set each pixel in myBitmap to black. Dim Xcount As Integer For Xcount = 0 To myBitmap.Width - 1 Dim Ycount As Integer For Ycount = 0 To myBitmap.Height - 1 myBitmap.SetPixel(Xcount, Ycount, Color.Black) Next Ycount Next Xcount ' Draw myBitmap to the screen again. e.Graphics.DrawImage(myBitmap, myBitmap.Width, 0, myBitmap.Width, myBitmap.Height) End Sub Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
password string question just use some of the String-Namesprace's functions to check for the chars you want to be there (and how many times etc.): Contains, IndexOf, IndexOfAny, ToCharArray, Char/Substring, Split, Replace, etc. you can always find a way to work with these. Personally - if I'd only want to make sure 1 of those specials chars is in the password - would be
If Password.IndexOfAny(new Char() {"*"c,"\"c,"."c}) > -1 Then 'Password is ok Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
How do I She¡¯s sort of cheating in that video as she¡¯s pre-populated that.
In order to add text to the toolbox¡ simply select some text and drag it to the toolbox (from within Visual Studio) or you can copy some text to your clipboard and then click on the Toolbox and paste it there.
In either case, once it¡¯s there you can simply right click on an item, choose Rename Item and type in a new name to change the display name. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
about email GUI? using vbee2005 There are actually a few Microsoft controls that you could find in the toolbox of the designer...
You may want to use a RichTextBox for the text portion, (which has built in features like cut, paste and so on...)
For the tools, look into a ToolStrip control. I'm not sure if the RichTextBox has font and color changes, but you could try it out and see. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Wrong Progresspercentage ? Hi,
I don't know if this is the cause of the problem but....
These two lines of code....
wc.UploadFileAsync(uri, file); //doesn't block wc.Dispose(); Your disposing the WebClient object while the asynchronous upload is still happening. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
A few questions 1: Me.textbox1.Paste() 2: My.Computer.Registry.GetValue 3. Yes 4.,5. shell("adress of the file") Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Object Null Reference does this work any different
Code Block
Mainform.Playlist1.removeItem(Mainform.Playlist1.Item(0))
oh wait sorry in your example playlist1 is a listview Maybe this is what you need
Code Block
Mainform.Playlist1.items(0).remove
Are you creating a media player playlist such as this
Code Block
Dim Playlist As IWMPPlaylist = Nothing
Playlist = player.newPlaylist( "vegas" , "" )
Playlist.appendItem(player.newMedia( My .Computer.FileSystem.SpecialDirectories.MyMusic & "\Elvis 2nd To None\19 - Viva Las Vegas.mp3" )) ' single song
Dim song As String () = Directory.GetFiles( My .Computer.FileSystem.SpecialDirectories.MyMusic & "\Elvis 2nd To None" , "*.mp3" )
For Each s As String In song
Playlist.appendItem(player.newMedia(s))
Next
player.currentPlaylist = Playlist
player.Ctlcontrols.play() Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
How could I read 300 characters from a text file? This is quiet cool, i asked the question but before any help was given to me I fiqured out a solution for it! To read a certain length of characters in any file I could do the following:
Code Snippet ' This creats an array from the specified file, in this case "C:\Text.Txt". Dim buffering() = My.Computer.FileSystem.ReadAllText("C:\Text.Txt").ToArray Dim i as integer While i <= 250 value = value & buffering(i).ToString i += 1 End while ' The variable `value` would contain the first 250 characters ' of the file which in this case is "C:\Text.Txt".
Then every time the next 250 or any other integer value of characters are required you could add the above While loop statment to obtain the next block of code. (The block of code could vary in this example it was 250, but it could be any thing you like, at every while loop statment) But insure that you don't change the value of ' i '. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
web browser stuff.. I will address questions 2 and 3 for you:
To show the page title in the form¡¯s title bar:
Hook up a Document_Completed event handler for the webBrowser and put this code into it:
this .Text = webBrowser1.DocumentTitle;
(To create a Document_Completed event handler, go to the Design view and select the webBrowser control. Then in the properties window, click on the lightning bolt icon which should show a list of events for the browser. Find the one labeled ¡®DocumentCompleted¡¯ and double-click it. This should take you back to code view and the event handler will be added. Put the code listed above into the handler.)
To prevent IE from opening a new window you need to intercept the NewWindow event. I presume you want to open a new window with another instance of your webBrowser form. And you want to be able to do the same by right-clicking a link.
Hook up a NewWindow event handler using the same technique above and add the following code:
Form1 f1 = new Form1 (lastUrl);
f1.Show();
e.Cancel = true ;
This creates a new Form1 (I am assuming that this is the form that your browser control is on), passes a string called ¡®lastUrl¡¯ (more on this later). Launches the form and cancels the event. So, whenever the browser needs to create a new window, this routine will make a new browser for you and stop the event from launching a window in IE.
Now, we need to make Form1 display the web page that we just passed to it. Make the constructor of Form1 look like this:
public Form1( string url)
{
InitializeComponent();
webBrowser1.StatusTextChanged += new EventHandler (webBrowser1_StatusTextChanged);
webBrowser1.Navigate(url);
}
This makes Form1 receive a string url and uses it to navigate the webBrowser whenever it is created. The webBrowser1.StatusTextChanged ¡ line hooks up an event handler that is not in the list of handlers that you can choose from in the properties window. So you will have to add this event handler like this:
string lastUrl;
void webBrowser1_StatusTextChanged( object sender, EventArgs e)
{
string s0 = webBrowser1.StatusText;
if (s0.Contains( "http" ))
{
lastUrl = s0;
}
toolStripStatusLabel1.Text = s0; //optional
}
The status text is what is displayed on the status strip at the bottom of most browsers. When you hover your mouse over a url, you will see this change. This bit of code looks for changes in this status and remembers the last bit of status that shows a url in the string variable ¡®lastUrl¡¯. This is the variable that we use to launch any new window either automatically or by right-clicking and selecting the ¡®open in new window¡± option from the context menu. Optionally, you can add a toolstrip wit a toolStripStatusLabel to the bottom of your form and display the status like most browsers.
Finally, one more bit of housekeeping. Assuming Form1 is the first form your program launches (it may not be since you have a splash screen), you will need to make the call to Form1 in the Program.cs file match your constructor. Change the Application.Run(new Form1()); line to:
Application .Run( new Form1 ( "" ));
This will provide the string to Form1 that the constructor is expecting.
I hope this explanation was clear. Here is the complete listing of my Form1 which has a webBrowser, textbox, button, and toolStripStatusLabel:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1( string url)
{
InitializeComponent();
webBrowser1.StatusTextChanged += new EventHandler (webBrowser1_StatusTextChanged);
webBrowser1.Navigate(url);
}
string lastUrl;
void webBrowser1_StatusTextChanged( object sender, EventArgs e)
{
string s0 = webBrowser1.StatusText;
if (s0.Contains( "http" ))
{
lastUrl = s0;
}
toolStripStatusLabel1.Text = s0;
}
private void button1_Click( object sender, EventArgs e)
{
webBrowser1.Navigate(textBox1.Text);
}
private void webBrowser1_DocumentCompleted( object sender, WebBrowserDocumentCompletedEventArgs e)
{
this .Text = webBrowser1.DocumentTitle;
}
private void webBrowser1_NewWindow( object sender, CancelEventArgs e)
{
Form1 f1 = new Form1 (lastUrl);
f1.Show();
e.Cancel = true ;
}
}
} Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Need help sorting this out databases, arrays, for loops, etc well basically you got it right, you need to loop through each row from 1 table within the other...if that makes sense.
you need to know however that the current column of data is an integer type otherwise you would get errors.
question is, which column are these values stored in
basically itll be something like this..
for each outerrow in table1
for each innerrow in table2
add to array, outterrow(column) - innerrow(column)
next
next Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
How to get stringbuilder to assign values to custom textboxes on a New e-mail window Can you explain what you are attempting to do in a little more detail
When you say " I use the following code to assign values to already defined fileds" I am not sure what you are talking about. the code you provide assigns some text to a variable. Do you then want to assign the variable to form fields or specifically a textbox
TextBox1.Text = theStringBuilder.ToString()
If this is not what you are looking for then I think more explaination is needed. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Hide Password Characters? Just set the PasswordChar to what you want to display, e.g.
TextBox1.PasswordChar = "*"c
will display asterisks instead of the actual characters you enter. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
About Uninstall directory in Registry Are you installing this as a privileged user I've seen some mentions about this issue in relation to installing with limited access. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Mp3 Coding ' Do a 'project' ' add reference' for the Imports
Imports Microsoft.DirectX
Imports Microsoft.DirectX.AudioVideoPlayback
Public Class Form1
Friend WithEvents m_Audio As Audio
Private Sub Button1_Click( ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
m_Audio = New Audio( "c:\song.mp3" , False )
Dim SongLen As Double = m_Audio.Duration
Dim SongMins As Double = SongLen / 60
MsgBox(SongMins.ToString( "00.00" ) & " Minutes duration" )
End Sub
End Class Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Of Pictureboxes, Transparency, Movement and Backgrounds Alright, I have found a partial solution to my problem. I have put the red arrows into the background of the form, and so the green arrows don't have that "boxy" problem anymore. HOWEVER, the program now moves really, really slowly. Is there some sort of solution for this Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
problem with msdn killer_instinct wrote:
i had downloaded the last msdn from msdn website
my problem is that msdn is compatible with my visual c++ 6.0 dated since 1998
i can't update to the last version because our teacher want us to work with visual c++ 6.0
If you are not going to be making Windows applications, you do not need anything that does not come with the Visual C++ 6.0 compiler. What do you expect to find in the MSDN Library that will matter for your class
You can use the MSDN that is part of Visual Studio 6.0 and should be included with Visual C++ 6.0, depending on the version.
MSDN On-line also has an archive of older material: http://msdn.microsoft.com/archive/default.asp Later MSDN Libraries on DVD / CD-ROM do not include this material. They also link to MSDN on-line for access to "legacy material."
The last MSDN that integrated in Visual Studio 6.0 was produced in 2003. The earliest version available for download is the MSDN Library May 2006 Edition (August 2006 is the most-recent available for download).
It is true that recent versions of the MSDN Library (and Platform SDK) on CD-ROM and DVD are not compatible with Visual Studio (and Visual C++) 6.0. However, you should be able to install the latest MSDN Library. It will simply not integrate with Visual C++ 6.0. You can use it outside of Visual C++ 6.0. I am not sure it will be very useful to you. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Visual Studio 2005 Express - how do i add and use active X controls? A general flow of adding a control to the toolbox
Open a form in the VB Express IDE
Right Click on the Toolbox and select Choose Items
Choose COM Components and Browse
Point to the appropriate file.
Click OK and it will now appear in the toolbox.
Now you can add the control to the form just like any other control.
Is the item an ActiveX control or just a COM DLL, If its a COM Class Library then once added as a reference, you should be able to use the classes and call the methods contained in the class library. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Bug?: Unwanted C4819 Well, you know, it is a warning. I don't think VC++ 2005 Express Edition has any way to tell that you are using Latin1. I think that is why it checks the default code page you are running under.
There's probably a #pragma clause that you could add to your #if material to suppress that particular warning.
I think we are seeing the difficulties of moving to Unicode while our systems don't support Unicode at the codepage and console application level and it is not possible to tell which non-Unicode format is being used on a computer except by checking the default code page setting. Sometimes, the programmer has to guess wrong in attempting to have a behavior that works most of the time.
- Dennis
MORE ANALYSIS:
Because the Forum web page is in UTF-8, I was able to paste your program into a blank C Language file using VC++ 2005 Express Edition on my code-page 437 configuration. I see the pound-Sterling symbol without any trouble, and I don't see any warning when I compile. But the program shows me a single "u" symbol when I compile it and run it in a console window. This is exactly what I deserve for character code 0xA3, of course, because that's what code-page 437 has to offer (its code for the pound-Sterling symbol being 0x9C).
So what do you see in your program's output when you compile and run it with VC++ under default codepage 936 Surely not '¡ê'
This article digs into some of the same problems you are reporting: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=306497&SiteID=1
I think one of the reasons for the warning is that the character literal '¡ê' (with 0xA3 followed by 0x27) is not a valid code-page 936 sequence and creating '¡ê' == 0xA1EA is apparently too over the edge (and won't produce the desired result anyhow), so it creates 0xFFFFFFA3 instead and then printf uses only the low-order byte.
I don't think the ' ' comes from the compiler. It comes from the run-time system when it doesn't recognize a code for the code-page you have installed. (I ran into all of this fussing with codepage 932 recently.)
The message is misleading. The advice about saving the file (that is, your test.c file) in Unicode format (UTF-8) is fine, but not so easy to do. You can use notepad to do it, and if the file is pasted into a blank page the way I did with your sample, it appears that the file is indeed saved in UTF-8 (the pound-Sterling symbol saves and restores just fine). The compiler can't tell you are using Latin1 because there are no markers that indicate the intended code as there are for UTF-8 and UTF-16 files on Windows. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Example of tabbed webbrowsing Tom,
Your links are really broken. :( Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
How to set up Status Label for Browser If your web browser is named webbrowser1 and the label is named toolstripstatuslabel1 and you had a progress bar named toolstripprogressbar1 then you would take these steps:
Make a timer, make sure it is enabled and put this code in the elapsed or tick event handler:
toolstripstatuslabel1.text = webbrowser1.statustext
For the progress bar put this code in the web browser's progress changed event handler:
toolstripprogressbar1.maximum = e.maximumprogress
toolstripprogress1.value = e.currentprogress
That code should display the status text and the current progress of the browser. Tag: Visual Basic Express Edition form transparent sometimes Visual Studio Express Editions
Tigerwood2006
We are developing a windows application at the moment. I built the program successfully, and then copy them across to one of my colleague's computer for testing. Generally the program works fine, except sometimes my colleague can see through the form (see the background image) when he showed the menu dropdown menu items across the toolstrip and even click on the icons behind! This weird behavior of the program is not visible on my computer. Note I copied all the dll,exe,manifest files from the debug folder to his computer. Did i miss some other files
Re: Visual Basic Express Edition form transparent sometimes
Tigerwood2006
That answer is spot-on! After deleting the color silver to use the default, it worked fine on the other machine now. Thank you so much, I wouldn't figure it out myself without your help.