Answer Questions
UnKnown Nick ComboBox SelectedValue
Hi, i have a doubt, I have a combobox and I'm binding it using BindingSource. The problem is that I show in the combobox the name of the field that is in the data base, but I store the key number in the database. My problem is that I can't insert the SelectedValue inside the database and it returns me that this field cannot be null, I really don’t know what to do, any ideas I tried setting the key using ValueMember, but this didn’t worked either. Your code example is binding your combobox to table "Grupo" to produce the pick-list, however where are you binding the "SelectedValue" property of the combo to the "Products" table e.g. this .comboBox_grupo.DataBindings.Add( new System.Windows.Form ...Show All
CodeButcher Clicking between forms
Hi, I' ve got two forms with buttons on both. I need to switch when I want between the forms. Now when I click on a button of another form. The Form gets first the focus. Then I need to click once more for the button_event. Is there a way to click just one time Grtz Annihil8 Hi, I don't understand what you want to achieve with this My problem is that the click events aren't triggered. First click triggers the frm.focus() then when pressing again the event will be triggered. Grtz Declare new variable with bool type, then change its value when the user click on a button. Hi Are you using MDI Child forms, or two forms are from two different application. I ...Show All
CManoj How to play a video fullscreen?
Hi all, I'm using VB 2005 and want to play a video in fullscreen mode. I've read lots of articles about it and now i'm confused. I've read about DirectX and Windows Media Player 9 and 10 and 3rd party tools, and now I don't know which one to choose I did not find any comparison overview to see the (dis-)advantages of each solution. I still need to generate the videos so I don't care about the format supported as I could create avi, mpeg, divx or whatever is supported. Maybe someone could post a recommendation what to use Many thanks! indeed. Add the COM component in your project for WMP then you can play the file using the URL property of the object instance and to play it in full screen, set the fullsc ...Show All
fasted64 Where are DialogKeys processed in Designer?
I want to be able to move the controls around in the desgner by pressing the arrow keys but I can't find where the ProcessDialogKey is being fired. Is it in a service somewhere I don't know about Ken I thought about this some and I think that I might not have had enought information in my original post and got you off track, or you are still thinking about that vacation. You said that "someone has to fire the event" and in your original post that "VS" routes the command to the window. I'm assuming here that VS is Visual Studio I'm not using visual studio, I'm using my own custom designer. Considering the comment about the event, who actually does fire it I'm thinkin ...Show All
hazz A challenge. Text to binary, and back.
In my windows forms application I need to develop a method to convert a string to binary and then back again. This is going to be a simple way of user authentication to secure the data. Aside from that conversion I will be doing another conversion with it to secure it even further. The only part I need to know how to do is the binary to text and back. Here's my logic: User inputs password -> Converts to binary -> my conversion -> finalized password User retrieves password -> my conversion -> converts to string -> original password Here is some history on what I am doing. For the last month or so I have been creating a security system with flexible user settings and user friendly GUI's. I have researched many diffe ...Show All
JeremyAtGosub Console Output from a Windows Form
I have a windows form program which also includes a command line interface to a few of its features. When command line options are pased to the program the GUI is not displayed, and the command line code is properly excuted. However none of the output to the console appears. I was able to get the console output to be displayed by having Visual Studio 2005 compile my program as a console app instead of a windows app, but this causes a console window to be opened when you run just the GUI portion of the program. Is there anyway I can get the console output to appear without having this console window opened with my program when running the GUI part The problem is a .NET application is considered Consol ...Show All
mmix TabControls/TabPages wierd problem when hosting Form Designer
I'm writing a form designer in C#, and I'm trying to modify the VS-style behavior for adding tabpages to a tab control. I want the user to be able to add a TabControl, and then to add Tabs just add them to the TabControl like a normal control. However, when I add a TabPage to a TabControl on the form, I get the following error message: Cannot add 'TabPage' to tabcontrol. Only Tabpages can be added directly to tabcontrols. This happens before execution hits my code (I have a breakpoint right at the start of the method attatched to the IComponentChangeService.ComponentAdding event, which is not triggered). Has anyone else come across this before I am using the IToolboxService service to provide the ToolboxItems. Thanks ...Show All
R_Vogel Datagridviewcolumn backcolor
Hello: I'm trying to specify the backcolor for a specific column in a datagridview (defaultcellstyle.backcolor). However, the color is only applied if the datagridview is selected by the user. How do I change the color so it displays whether the dgv is selected or not Thanks much. Thanks for the reply. I tried that before and the same problem exists: the back color doesn't appear until one of the datagridview column headers is clicked. Not sure why it is not updating the column's back color but you can always invalidate the column to get it to redraw dataGridView1.Columns[0].DefaultCellStyle.BackColor = Color.Red; dataGridView1.InvalidateColumn(0); ...Show All
kaanuki Textbox Jam
The textbox is bound to a binding source the data is verified on the keyup event; Private Sub tb54_KeyUp( ByVal sender As Object , ByVal e As System.Windows.Forms.KeyEventArgs) Handles tb54.KeyUp Dim tb As TextBox = sender Dim tp As Integer = tb.SelectionStart - 1 Dim i As Integer = tb.Text.Length For k As Integer = 0 To i - 1 If Not Char .IsDigit(tb.Text.Chars(k)) AndAlso Not tb.Text.Chars(k) = "." Then tb.Text = tb.Text.Remove(k, 1) tb.SelectionStart = tp Exit For End If Next End Sub if the text box is empty & a character is put in that's not a dot or digit it's removed & the app jams , the curso ...Show All
RyanB88 Equivalent of ShowWindowAsync in .net
Does any body know equivalent of the following in .net ShowWindowAsync. Which is used to maximize the control by getting the handle. Thanks & Regards, M.S.Basha ...Show All
holy_spirit minimize, maximize, and close button image...
hey, In Visual C# 2005 express how would I use some images I made for the minimize, maximize, and close buttons, and change the defaults to the ones I made The images are .PNG if that is somthing you need to know... Thanks :) You inherit directly from LonghornForm. I think I used the demoform as my base class instead of longhorn. What about this 2 settings Have you played around with these appearance.BorderSize = new Padding (3); appearance.TitleBarSize = 32; The other thing is that the actual images used for the buttons are probably padded already. So I am gunna have to do alot of code just to make a image ...Show All
Jake.K C# context menu
Hi, all, Can I use context menu without mainMenu For example, i append this context menu on one button. When I click the button, the context menu will show on the button for me to choose one option. When i choose the option, the menu will disappear and the option i choose will show on the button text. If i can't do this, any suggestion about this. Thanks in advance. : ) You can derive a new class from ToolStripDroDown and override the ProcessDialogKey() method. Otherwise, arrow keypresses seem to get eaten. Josh Usovsky Thanks, Josh. Really helpful sugggestion. Looking into it now. However, anyone knows how to "flip" the drop down me ...Show All
Deedhun PictureBoxes in FlowControlPanel + dev advice?
Hi all, I'm adding a series of pictureboxes to a FlowControlPanel (love that control!). When a user clicks on the picturebox, options will be available to them via a context menu. Thing is, I'll also want to display some text with the image, so I'll be needing a composite control consisting of a picturebox and a textbox, and the composite control will be placed in the FlowControlPanel instead. The question is, seeing as I'm retrieving the image to go in the picturebox from a db, where should that work be done I believe I have two options: 1) Do the database retrieval of the image and text in the custom control itself, either in the constructor or via a method that Page_Load calls. The updating of the properties would then be ha ...Show All
SAD1 Windows timing
Here is the very sophisticated program I just wrote: Imports System.Threading Public Class Form1 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load For i As Integer = 5 To 50 Step 5 Dim starttime As DateTime = Now For j As Integer = 1 To 50 Thread.Sleep(i) Next Dim endtime As DateTime = Now Dim totaltheo As Integer = 50 * i Dim totaltime As Double = endtime.Subtract(starttime).TotalMilliseconds Dim actsleep As Double = totaltime / 50 TextBox1.Text += "sleep time: " + i.ToString + " ms; actual sleep time" + actsleep.ToString + " ms; total time" + totaltheo.ToString + " ms; actual total time&q ...Show All
ahmedWebDev make your own DialogBox
hi I want to make my special MessageBox. so I have a form and develope all the specified codes that I need. but I dont know what I should do to make the form behave as a MessageBox for example, first I want to freeze everything and stop the folowing codes when it shows and continue the process when it closed. but I dont know how to do it. on the other hand I may ask my question in this way: how can I stop processing the folowing codes until some conditions (like click the button of another form) note that the form will be shown in the middle of the codes and folowing codes needs some values that will set with this form. I am really looking forward your answers Regards A message b ...Show All
