我希望此Tkinter canvas可滚动,获取复选框的输出以选择列

这是选择我需要的列并以此创建文件的代码。但是如果画布多于20列,则画布太小而无法获取所有列。并退出画布。我尝试添加滚动条,但根本不起作用。我是python的新手。谢谢。

string connetionString = null;
        MySqlConnection cnn ;
        connetionString = "server=localhost;database=testDB;uid=root;pwd=abc123;";
        cnn = new MySqlConnection(connetionString);
        try
        {
            cnn.Open();
            MessageBox.Show ("Connection Open ! ");
            cnn.Close();
        }
        catch (Exception ex)
        {
            MessageBox.Show("Can not open connection ! ");
        }

尝试滚动

import tkinter as tk
from tkinter import filedialog
import pandas as pd    

打开文件

def on_configure(event):
    canvas1.configure(scrollregion=canvas1.bbox('all'))    

def browse():#to browse the file path
    global f
    global export_path
    global export_path_ing
q178455231 回答:我希望此Tkinter canvas可滚动,获取复选框的输出以选择列

这篇文章应该回答您使滚动条正常工作时的大多数问题,我过去曾用它来使我的滚动条正常工作

Tkinter scrollbar for frame

在我看来,您正在尝试将滚动条添加到父tk实例,我认为您必须将其添加到框架而不是该“窗口”。

这是另一个类似的问题

tkinter: using scrollbars on a canvas

本文链接:https://www.f2er.com/3104280.html

大家都在问